You should note that I do not advise running Microsoft Windows. Or any software that is end-of-life, unless you are able to patch it yourself. And, so, I especially do not advise people to go configure Windows 7 to host Django using mod_wsgi
Configuring Django on a WAMP Host
Quick Navigation
Getting Apache ready for Django, on a WAMP host machine, can sometimes be problematic. Particularly because setting up mod_wsgi on Windows (in this case Windows 7) isn’t always straight forward. I’ll be using the deprecated Python 2.7 on Windows with WampServer installed.

Install the mod_wsgi Apache module
- Download mod_wsgi-win32-ap22py27-3.3.so. Or download your respective .so compatible file
- Change its name to
mod_wsgi.so
and - Copy it to
$DRIVE/Program Files/Apache Software Foundation/Apache22/modules
- Open
httpd.conf
as Administrator, or equal. Here, you’re going to find a list of lines with “LoadModule
” followed by a bunch of other “.so” files. Simply addLoadModule wsgi_module modules/mod_wsgi.so
to that list. - Restart Apache.

Creating Configuration Files for Django on WAMP
- Next you have to point it at Django
- In your Django project root folder, create an
apache
folder - Change into that directory and create a file named
django.wsgi
- And, finally create a file named
apache_mydjango.conf
- Go back to apache’s
httpd.conf
and add the following line at the bottom of the page:Include "$DRIVE:/projects/mysite/apache_django_wsgi.conf"
- Now put these lines in
django.wsgi
:
Populating Configurations for Django on WAMP
import os, sys
sys.path.append('D:/projects/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
- Open
apache_djang_wsgi.conf
and prepend:
Alias /images/ "D:/projects/mysite/templates/images/"
<Directory "D:/projects/mysite/images>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / "D:/projects/mysite/apache/django.wsgi"
<Directory "D:/projects/mysite/apache">
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot D:/projects/mysite
ServerName 127.0.0.1
</VirtualHost>