How to install Python and Django in Windows Vista
This is possibly one of the easier ways to install a Django development environment for your Windows Vista 32-bit machine. (Alternatively, there’s Instant Django, it’s much like Instant Rails where you just extract it out and can start immediately.)
0. Objective
Objective is to create an application with Django. This guide assumes you have no knowledge in Python, Django or Windows Vista. It does, however, assumes you know and already set up MySQL nicely. Just for you information, I use XAMPP Lite for development in PHP. I run XAMPP Lite’s MySQL and administer my MySQL with phpMyAdmin.
Let’s look at the required downloads. We will need 3 things:
- Python 2.5: Django requires Python to function, we’ll grab the latest Windows binary here. (Get the one that says something like Python 2.5.2 Windows installer)
- Django: You can get Django here. Use option 2 if you don’t know what SVN is about.
- MySQL for Python: This lets Python use MySQL, it does not install MySQL. You can get it here. (Download the one that says ‘MySQL-python-1.2.2.win32-py2.5.exe’ inside the ‘mysql-python‘ package.
1. Installing Python 2.5
The installer is pretty straightforward. This guide assumes you install in ‘C:\Python25\’, the default installation directory. (Do not install in your Program Files as Program Files somehow has lesser access rights.) You should not encounter any error.
After completion of the Python 2.5 installation, set up your environment variables. We want to be able to just type ‘django-admin.py startproject mysite’ in the command prompt. In order to do that, you will have to specify the directory that Windows Vista can search for to find ‘django-admin.py’.
We can do so by going to your Control Panel and type ‘environ…’ at the search area. We’ll get the following:

Click on ‘Edit the system environment variables’, a dialog box will pop up. Click on ‘Environment Variables…’, you should be greeted with the following dialog box:

My path looks like this before I add anything:
Append these two directories at the back of what is already there:
Remember that each directory has to be separated with a semicolon. My Python is installed in ‘C:\Python25′.
2. Installing Django
Extract the Django package that you download to ‘C:\django\’. Use the Command Prompt to navigate to the folder you extract to, in our case, we can type this command:
Then we have to set up Django:
And we wait for the the installation to complete. On completion, Django is now fully installed. Let’s try to create an application now to see if it’s working. I created a folder at ‘C:\projects\’ to store all my projects. Once again, we use the Command Prompt to navigate there:
Then we create our first Django application:
Note your C:\projects, it now has an additional folder called ‘mysite’ with the following files:
mysite/
__init__.py
manage.py
settings.py
urls.py
Okay, let’s try to see if every thing is working fine.
We will start the server now within the ‘mysite’ directory:
The following should appear:
Validating models…
0 errors found.Django version 0.97-pre-SVN-unknown, using settings ‘mysite.settings’
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Note that the version number is different, depending on what you download. Now go to your browser and type in ‘http://127.0.0.1:8000/’.

And it worked! Congratulations on your first Django-powered page.
3. Installing MySQL for Python

Once again, I assumed you had MySQL installed already and know how to run and use it.
Run, in administrative mode, the file you just downloaded - MySQL-python-1.2.2.win32-py2.5.exe.
You may run into errors if you do not install as an administrator due to Windows Vista’s security model.
Now, let’s test if the MySQL installation worked. Run the server if it isn’t started. Edit the database setting in ‘mysite/settings.py’.
Update your database information. Save your file. The server will detect a change once you save your file and start to check for errors again. (I personally find this really cool.)
Here’s what I fill in. Your user may not be ‘root’.
DATABASE_ENGINE = ‘mysql’
DATABASE_NAME = ”
DATABASE_USER = ‘root’
DATABASE_PASSWORD = ”
DATABASE_HOST = ”
DATABASE_PORT = ”
If you see no error messages, the database is correctly set up. To do a bit of testing, we can set our user name wrongly on purpose and watch Python throw out the errors then correct it.
Fill in your DATABASE_NAME correctly and we can start coding already. You can continue on the Django tutorial here.
[Forgive me if there're any mistakes in this tutorial and feedback to me.]
Thanks for posting this - it all just worked!! Looking forward to getting my toes wet now
Apr 25
Nice job. Your version is very detailed. Mine is a little more concise:
http://siliconloop.blogspot.com/2008/04/how-to-run-django-on-windows-vista.html
Apr 25
nice post, but you miss up apache part!
Apr 27
@Jon Sidnell: Have fun!
@edison chan: It doesn’t require Apache to run actually. Django comes with a built-in web server that makes it so easy to quickly start development. Really cool stuff.
Apr 27
cool job, saved me a lot of googling.. thank you
Jul 28
Thank you for this!
Aug 13