2.5 install Django
2.5.1 decompress twice to get the folder Django-0.96.1. Put this folder in your development directory. It is recommended that you do not place it on the desktop. It is best to place it in a directory such as D: \ Dev \. Note that the folder name should be in English and there should be no spaces.
2.5.2 enter the directory at the command prompt and enter: cd d: \ Dev \ Django-0.96.1
Run Python setup. py install.
(At this time, the screen will scroll and display a lot of things. You can't see it clearly)
OK.
2.5.3 perform a simple test first.
At the command prompt, enter: Python
Enter import Django
Enter Django. Version
What I see is:
>>> Import Django
>>> Django. Version (0, 96.099999999999994, none)
>>>
2.5.4 set the environment variable (add ../python2.5.1 \ Lib \ Site-packages \ Django \ bin to the path environment variable)
2.6 create and test a Django Project
C: \ django_src> CD \
C: \> mkdir Django
C: \> Cd Django
C: \ Django> django-admin.py startproject testdemo
C: \ Django> Cd testdomo
After running manage. py runserver, enter http: // 127.0.0.1: 8000/in the address bar of the browser/
If the preceding figure is displayed, the installation is successful.
Eclipse Django Development Project
Django Project Development
1. Create a pydev Project
Eclipse IDE-"file-" new-"Other-" pydev-"select the path from" pydev project-"to" project name (for example, demo)-", such as E: \ work-> select the Python version that suits you (my version is 2.5)-> remove the following check box, do not create the SRC file-> finish
2. Create a Django Project
(1) django-admin.py startproject demo.
(2) copy the generated Django project directory to the directory of the project just created in eclipse. Return to elicpse ide. In the pydev package view, right-click the new project and select "refresh" from the pop-up menu to view the Django project. You can right-click the menu to add or delete files and directories.
(3) Right-click pydev project-> properties-> select pydev-> pythonpath-> Add the src directory (project file path) to the project code-> OK
Do not copy it here. After installing Django, reconfigure python in eclipse, and then directly create the djangoproject.
(4) configure the pydev project: select the project name of pydev-run menu-open run dialog-Python run-right-click New-and write the project name in the main panel, load the project name and main module through browse, and select Manage for main module. py-> In the augement panel, the argument must be runserver -- noreload, and the following workingdirectory must be added to your base directory.
After finishing the job, start writing the Django application.