Many readers have asked me how to install Python and Django. Although there are tutorials on the official website, they are all in English and do not know what operating system he uses,
Here I will briefly introduce the installation steps of these two software in Windows XP.
1. Python Installation Steps
There is no good introduction to Python installation, that is, the next step is to complete. Then add the python installation path to the path of the environment variable, as shown in figure
The installation path of my python is D: \ Program Files \ python26. You only need to append the path to the value of the path of the environment variable.
Here, by the way, the role of environment variables is described. Environment variables are used to tell the location of the command line when you execute a command through the command line, such as when installing Django.
The Python command to be used. The command line will first search for the pythoncommand in the folder before, and also find python.exe. If it cannot be found, it will find the path value in the environment variable.
If it still cannot be found, the system will throw an error that is not an internal command. The above is my personal understanding.
2. Django Installation Steps
The installation of Django is simpler. First extract the downloaded compressed package, then run the command cd in the command line to enter the Django folder, and run the command:
Python setup. py install
If the error message prompts you that python is not an internal command, it indicates that your environment variables are not configured properly. When the command runs normally, a large number of files are listed.
It copies these files to the directory of Python/lib/Site-packages.
Configure the PATH variable of the environment variable, and append the scripts folder path under the python installation directory. For example, my path is D: \ Program Files \ python26 \ scripts.
OK, so that Django is installed. Now let's create a project to verify it. Shut down the command line before opening it. Otherwise, the newly appended environment variable cannot be found.
Then CD enters the folder to create the project, enter the command: django-admin.py startproject mysite, will create a mysite folder under the current folder when running normally,
There are several Python files in it. If you are prompted that the django-admin.py is not an internal command, it means that your environment variables are not configured, or you haven't re-opened the command line window,
Or you have not installed Django at all.