1. Python Installation
Python must be installed before installation. I use python2.7.
Because Django does not support version 3.0, only version 2.7 can be used. Python http://www.python.org/
2. Install Django
(1) Cd in cmd to the installation directory of your installed Django, you can see the setup. py file.
Then execute Python setup. py install in cmd. Now the command line has automatically started to install Django. Django
Http://www.djangoproject.com/download/
(2) then enter the command in cmd
: Python
>>> Import Django
>>> Django. Version
>>> (1, 2, 3, 'final', 0)
The Django version information displayed above indicates that the installation is successful.
(3) create a project
Django installed under the python directory this django-admin.py is under the python27/scripts directory
So CD to this directory
Execute the django-admin.py startproject mysite
Project created
(4) Run
CD to mysite
Execute Command
Python manage. py runserver
The following information is displayed:
Validating models...
0 errors found
Django version 1.2.3, using settings 'mysite. setting'
Development server is running at http: // 127.0.0.1: 8000/
Quit the server with CTRL-BREAK.
[22/OCT/2010 13:28:14] "Get/HTTP/1.1" 200 2051
Enter http: // 127.0.0.1: 8000/in the browser/
The following information is displayed:
It worked!
Congratulations on your first Django-powered P