1. install Apache 2.0.59
http://mirror.vmmatrix.net/apache/httpd/binaries/win32/apache_2.0.59-win32-x86-no_ssl.msi
28.0 install mod_python-3.2.10.win32-py2.4-apache2.2.exe
http://www.apache.org/dist/httpd/modpython/win/3.2.10/mod_python-3.2.10.win32-py2.4-apache2.0.exe
after installation, prompt you to choose the installation directory of apache2.0, install the mod_python.so file to the modules directory of apache
3. Download and install Django through SVN
SVN Co http://code.djangoproject.com/svn/d Jango/trunk/
4. Create a Django project.
for example, create the Django project newtest in the E:/Django directory and enter:
django-admin.py startproject newtest
(note that C: \ python24 \ scripts is set to the path of the system)
5. Use the built-in WebServer of Django to test this project.
in the E:/Django/newstest directory:
Manage. PY runserver
enter http: // 127.0.0.1: 8000 in the address bar.
see:
it worked!
congratulations on your first Django-powered page.
the Django website is successful.
let's see how to deploy it in Apache.
6. Modify httpd. conf.
Add
Loadmodule python_module modules/mod_python.so
Add
<Location "/newtest/">
Sethandler Python-Program
Pythonpath"['E:/Django ']+ SYS. path"
Pythonhandler Django. Core. Handlers. modpython
Setenv django_settings_moduleNewtest. Settings
Pythondebug on
</Location>
<Location "/Media/">
Sethandler none
</Location>
<Locationmatch "\. (JPG | GIF | PNG) $">
Sethandler none
</Locationmatch>
7. Restart Apache and check http: // 127.0.0.1: 8080/newtest.
You can see the same effect of Django's built-in webserver.