My Learning environment is Windows 7, first install Python, I installed the version is Python 2.7, after the confirmation "C:\Python27\Scripts; C:\Python27; " These two paths are added to the path system variable.
Figure A
Then download Django. The version I downloaded is django-1.8.tar.gz. Then unzip, the command line into the extract directory, with the "setup.py Install" command to install. After the installation is complete, enter "Import Django" in the Python shell, and if there is no error, Django has been installed successfully.
Figure II
Create a new folder in any location (with no name), such as Mywebsite. Enter mywebsite in the cmd window and create a new Django project named MySite with "django-admin.py startproject MySite". (In fact, after installing Django, there is a django-admin.exe tool in the scripts directory under the Python installation directory, which is what is used here.) )
Might
Figure Four
Once the Django project is built, we can look at its directory structure. In the MySite project directory, there is a manage.py file, and there is a mysite directory.
Figure Five
In the MySite directory, there are __init__.py, settings.py, urls.py, wsgi.py four files.
Figure Six
Django comes with a Web server for rapid development, and we Run "manage.py runserver" in the MySite project directory to start it. When "Quit the server with Ctrl-break" appears, the server started successfully.
Figure Seven
The URL in the browser to access the prompt when the server starts. At the same time, we can also see the cmd window where the server records the GET request ().
Figure Eight
Simple learning of Python's web framework Django (i)