1. Download httpd-2.2.16-win32-x86-no_ssl.msi Installation
NOTE: If IIS is enabled, stop it.
2. Download mod_wsgi-win32-ap22py26-3.3.so
: Http://code.google.com/p/modwsgi/downloads/detail? Name = mod_wsgi-win32-ap22py26-3.3.so
3. Modify the mod_wsgi-win32-ap22py26-3.3.so to mod_wsgi.so and copy it to C:/program files/Apache Software Foundation/apache2.2/modules (the specific directory is the directory where you install Apache)
4. Modify httpd. conf (generally in C:/program files/Apache Software Foundation/apache2.2/conf) and add the following content:
Loadmodule wsgi_module modules/mod_wsgi.so
Wsgiscriptalias/"D:/Django/bin/blogmysite/Django. wsgi"
<Directory "D:/Django/bin/blogmysite">
Options followsymlinks
AllowOverride none
Order deny, allow
Allow from all
</Directory>
Note: Install Django in D:/Django.
The new proejct is called blogmysite.
The newly created app is called blog.
5. Create a wsgi file in the project directory (my file is D:/Django/bin/blogmysite/). The content is as follows:
Import OS
Import sys
Import Django. Core. Handlers. wsgi
SYS. Path. append ('d:/Django/bin ')
SYS. Path. append ('d:/Django/bin/blogmysite ')
SYS. Path. append ('d:/Django/bin/blogmysite/blog ')
OS. Environ ['django _ settings_module '] = 'blogmysite. setting'
Application = Django. Core. Handlers. wsgi. wsgihandler ()
6. Browse and enter http: // localhost/blog to display normally
If an error occurs, view C:/program files/Apache Software Foundation/apache2.2/logs/error. log.
If the following error occurs:
Importerror: No module named XXX. Models
Or
[Tue Aug 17 23:11:22 2010] [Error] [client 127.0.0.1] importerror: cocould not import settings 'xxx. setting' (is it on SYS. Path? Does it have syntax errors ?) : No module named XXX. Settings
You can add relatedProgramDirectory (SYS. Path. append ('your directory'), be sure not to end)