1: Install python2.7 python-2.7.3.msi
2: configure the environment variable C: Python27;
3: configure the python environment in eclipse.
4: Install pyDev. You can download the compressed package, decompress the package, and copy the files in the two directories to the corresponding eclipse directory (plugin and features ). configure Window> preferences> pydev> interpreter> new... find your python installation directory
5: perform a simple test after installation.
6. install and configure django. I use django1.4.
7: Download Django-1.4 link https://pypi.python.org/pypi/Django/1.4
8: Decompress the downloaded django and run the command line to enter the directory E: Django-1.4 to execute the command python setup. py install
9: Install MySQL-python
Simple installation: run the script http://peak.telecommunity.com/dist/ez_setup.py in eclipse with the easy_install Tool
After installation, make sure that the directory where easy_install is located has been added to the PATH environment variable:
C: Python27Scripts
Python MySQL support. You can execute the following command. The system will automatically find the related software package in the pypi website list: easy_install MySQL-python
Problems may also occur during installation, which may be caused by python environment variables or compilers. Of course, you must install MySQL before installing mysql-python.
10. Compile the django project in eclipse after installation.
11: simple test of new pydev django project
12: Create a helloworld. py file under the package and write
From django. http import HttpResponse
Def index (request ):
Return HttpResponse ('Hello World! ')
13: modify the content of the urls. py file:
From django. conf. urls. defaults import patterns
Urlpatterns = patterns ('',
(R' ^ $ ', djangoTest2.helloworld. Index ')
)
Note that the path in urls. py must be the path of your project file.
14. Right-click the project and access http: // 127.0.0.1: 8000/to display Hello World!