Configuration diagram for the development environment of Python+Django under Windows
- 2020-04-02 09:31:16
- OfStack
1 Install the configuration development environment
1.1 Ready to install
Download the following software
(link: http://download.actuatechina.com/eclipse/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-win32.zip)
(link: http://www.java.net/download/jdk6/6u10/promoted/b32/binaries/jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe) don't have to be 1.6, 1.5 can also
(link: http://218.15.143.183:82/down/python-3.1.zip) (link: http://www.python.org/ftp/python/2.6.4/python-2.6.4.msi) (link: http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi)
(link: http://apache.mirror.phpchina.com/httpd/modpython/win/3.3.1/)
(link: http://nchc.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.2/MySQL-python-1.2.2.win32-py2.5.exe)
(link: http://pysqlite.googlecode.com/files/pysqlite-2.5.5.win32-py2.5.exe)
(link: http://nchc.dl.sourceforge.net/project/pydev/pydev/Pydev%201.5.0/org.python.pydev.feature-1.5.0.1251989166-sources.zip)
(link: http://media.djangoproject.com/releases/1.1.1/Django-1.1.1.tar.gz)
1.2 Apache installation configuration
I was too lazy to configure it, so I found a suite of Apache+mysql+ PHP directly from the Internet.
Can go to http://www.newhua.com/soft/71111.htm to download and install mod_python - 3.3.1. Win32 - py2.5 - Apache2.2. Exe let apache support python now we configure C: \ ESSamp \ Apache2 \ conf \ HTTPD conf file, to join
LoadModule python_module modules/mod_python. So
To run ESSamp, click "run" to start the service
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012017310.png" >
Click "browse the default website" and see the following screen, that is, the installation is successful
< img border = 0 height = 436 SRC = "http://pic002.cnblogs.com/img/nick4/200911/2009110913295895.png" width = 564 >
1.1 Eclipse, python installation configuration
1.1.1 Install the JDK
1.1.2 Unzip Eclipse, I put it under C:\ Eclipse
1.1.3 Install python
Install the corresponding Python version, which is Python 2.5, now Django only supports 2.5, other versions can exist at the same time, install mysql-python-1.2.2. win32-py2.5 let Python support MySQL database, pysqlite-2.5.5.win32-py2.5 let Python support sqlite database, Unzip python. Pydev. Feature -1.5.0.1251989166-sources. Zip the two directories inside to the root of the eclipse installation "C:\eclipse"
1.1.4 To configure environment variables, on the desktop "my computer" click the "properties" menu, select the "advanced" TAB, and click "environment variables..." Button, modify the system variable Path=; %JAVA_HOME%\bin, add directly after, as shown
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018863.png" >
Two more system variables
JAVA_HOME = C: \ Program Files \ Java \ jdk1.6.0
The CLASSPATH =. % JAVA_HOME % \ lib \ tools. Jar; % JAVA_HOME % \ lib \ dt. The jar
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018528.png" >
1.1.5 To launch Eclipse, select the menu "Help" - > "Install New Software..." , popup dialog box, as shown
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018149.png" >
Click the "Add..." Button, input address, click "OK" button, as shown
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018658.png" >
In "work with", select the newly added Pydev Extensions and you will see the latest version of the software
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018201.png" >
Click "Next" after selecting all > "
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018873.png" >
Click "Finish" to complete the upgrade.
1.1.6 Select the menu "Window" - > "Preferences" pops up, as shown
< img border = 0 height = 578 SRC = "http://files.jb51.net/upload/2009-11/20091111012018121.png" width = 702 >
Click "New..." Button to add the python installation path, click "OK".
1.2 Django installation configuration
1.2.1 The installation
Extract the Django, I am into python25, a setyp in Django directory. Py files, open the run window to install < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018983.png" >
1.2.2 To facilitate development, let's configure the system variables again
Path = C: \ Python25 \ Scripts; C: \ Python25 \ Lib \ site - packages \ django \ bin
1.2.3 Test for a successful installation of Django
First see if C:\Python25\Lib\site-packages\django\bin exists and then create a project
Django - admin. Py startproject testemo
< img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091111012018277.png" >
After running manage.py runserver, type in the browser address bar (link: http://127.0.0.1:8000/)
< img border = 0 height = 427 SRC = "http://files.jb51.net/upload/2009-11/20091111012018294.png" width = 655 >
The above screen appears, that is, the installation is successful