This article describes how to install Django using Python and how to create a project
The example described below is performed under python2.7 and the python3.x operation is the same (and can be omitted from the environment configuration)
View PIP version
install Django, "1.10.3" is the Django version number
After the installation is successful, you will see the Django_admin.exe file in the directory
View the Django version
Configuring Environment variables
Add the Python path and the Django path to the system environment variable separately
Enter the "django-admin" command at the Windows command prompt to display the commands provided by Django
Create a new folder and start creating the project with the Startproject command, NSDS I get the project name casually
After creating, open the NSDS, below a brief introduction to the table of contents (refer to the Novice tutorial)
|--nsds| |--init.py| |--settings.py| |--urls.py| |--wsgi.py--manage.py
manage.py A useful command-line tool that allows you to interact with the Django project in a variety of ways.
nsds/init.py An empty file that tells Python that the directory is a python package.
nsds/settings.py The setup/configuration of the Django project.
nsds/urls.py The URL declaration of the Django project; A "directory" of Django-driven Web sites.
nsds/wsgi.py a WSGI-compatible WEB server's portal to run your project.
View the commands provided by manage
Start service: Using the Runserver command, the default address is "127.0.0.1:8000"
You can also specify an address
Python manage.py runserver 127.0.0.1:8001
If the startup succeeds, enter the address in the browser as shown in:
Enter "127.0.0.1:8000/admin" (admin is a backend management system that Django comes with.) )