Here 's a summary of the setup of the Django Environment in the window environment:
First we open the Django official website https://www.djangoproject.com into the following pages:
Click Download to enter the download page:
On this page, we know that to install Django, we can first install the PIP tool in our Python swap, and Pip is a package management tool in Python where we can download and install the various packages and modules we need in the development process. Access to the PIP link https://pip.pypa.io/en/latest/
The following figure:
Click Installation to enter the PIP installation interface to find the installation method for the PIP in the Windows environment:
In the CMD interface, perform the python-m pip install-u pip This command to install the PIP, after the installation completes, executes the PIP this command, will prompt the command not to execute, this time needs to set the environment variable, the python installs the path the scripts The path is added to the environment variable, for example, my path is D:\Program files\scripts, and the configuration environment variable looks like this:
You can then execute PIP commands in the CMD interface, performing pip install Django for Django installation,
This time the display is successful, configure the Django environment variables, locate the Site-package file under the Lib folder under the Python installation directory, and add the Django file directory, for example, my directory is D:\ProgramFiles\Lib\ Site-packages\django, you can use Django:
This completes the Django installation.
The following is the creation of our first Django project, which executes django-admin.py startproject MySite in the cmd interface, creates a MySite folder under the current folder, and the CD switches to this folder, To perform manage.py Runserver, the following interface appears:
And then enter 127.0.0.1:8000 in the browser, you can successfully enter the Django home page:
This is the setup and simple use of the Django environment under Windows, and please correct me in the wrong place.