Django Development Summary: django Development
First, I used a virtual machine, python3.6 + django1.11.0:
To ensure version consistency and a better environment experience, we need to first run the virtualenv command in the virtual environment:
1. create an environment (name is the name of the virtual environment) virtualenv name 2. activate the virtual environment: source name/bin/activate 3. exit the virtual environment: deactivate 4. uninstall virtual environment: sudo pip uninstall virtualenv
We first enter the virtual environment and then install the required environment in the virtual environment and create a new django project, its command: django-admin.py startproject name
It can be found that there are several files and manage. py file, setting. py is a project file for configuring django, and urls is a url for configuring django, which uses a regular expression to write the address.
Run python manage in the virtual environment. py startapp name to create the app. After the app is created, add the app to the root directory and add the name of the app you created to INSTALLED_APPS in setting.
We can see that there are several py and models in the app. py is used to create a database in python, views. py is a visual, admin. py is used to manage users and customize user management.