Install Python and Django with Xampp on Windows 7

Install Apache

You will need to have Apache and MySQL installed on you PC, I used Xampp which you can download from here: Xampp for Windows

Download and Install Python 2.7

Do to the Python website and download version 2.7 Windows Installer ( At the time of writing version 3 lacks a lot of 3rd party plugin support.

Go through the standard install process, it should install Python to C:\Python27\

Install modwsgi for Apache

Download modwsgi for Apache and put the file into the Apache module folder (in Xampp found here: C:\xampp\apache\modules)

Add the link to httpd.conf around line 130 (but it doesn’t really matter where), the file is usually found in C:\xampp\apache\conf\

LoadModule wsgi_module modules/

Add Python to System Path

Add the following to windows system path. In windows 7 this is found in Control Panel\All Control Panel Items\System then advanced system settings, then environment variables, then under system variables you should see path, click edit and add this to the end of the line.


Restart Computer

Download Django

Go to Django Download Page and download Django, unzip it (I use zip). Out Django into a folder you can remember, I put it into the folder in C:\xampp\htdocs. Open up command prompt by clicking start, and type the following into the search box, then press enter. A black window should appear this is windows command prompt.


Navigate to the Django directory by using the command cd django directory (cd stands for change directory), for example:

cd /xampp/htdocs/django/

To setup Python type

python install

Download and install mysqld module

Restart Computer

Setup Your First Project

In the command prompt to create a new project type the following (obviously changing the location and name of the mytestprojectname): startproject mytestprojectname

Start the Python Server

Navigate to the new project

cd mytestprojectname

Start the server

python runserver

Test it is up and running by going to http://localhost:8000 you should get a it worked webpage!

Further Reading

I highly recommend reading The Django Book (which is free online).