Python and Django installation in Window environment, Project Creation, pythondjango
1. First, we need to download python and Django.
Python: https://www.python.org/
Django address: https://www.djangoproject.com/
2. Install the python environment before installing Django.
A. After downloading the python installation package, click next)
B. Configure python Environment Variables
C. Test whether python is successfully installed. Open the command line in cmd and enter the python command.
3. Start to install Django. We need to use CMD when installing Django. In the cmd command window, run the cd command to enter the Django decompression directory and find the setup. py file.
4. Use python setup. py install to install Django. Wait until the installation is complete.
5. check whether there are any errors after the installation is complete.
6. Run python, import Django, import Django, and then Django. VERSION to check whether the installation is successful. If the installation is successful, its version is displayed.
7. Configure django environment variables, C: \ Python27 \ Lib \ site-packages \ Django-1.7.11-py2.7.egg \ django \ bin path for calling when performing django-admin.py (personal understanding)
8. Create a project. The command is the django-admin.py startproject projectname is the project name (not executed in the Python command line ). This document is based on drive F.
For example:
9. After the project is successfully created, the directory structure is shown in figure
10. Start the built-in service: Enter python manage. py runserver in the project folder. For example
11. for verification, enter http: // 127.0.0.1: 8000/in the browser and you will see it.
The first python + django development environment can be run.
Legacy problems?
1. Each time you create a project, the port number is 8000. How do I set the port number and disable the running port number?