How to install Django in Python on Windows Vista

I am a complete beginner of Python. Django is one of framework of Python.
It was not clear for me when I read how to install Django on Windows Vista.

So here is what I did.

1. Install Python. I installed Python 2.5 instead of 2.6. Because Google App Engine works on 2.5. You can download 2.5 from here or here. I downloaded from TracOnWindows. It is a windows installer and Python website was not clear if it is a windows installer or not.

2. Download Django and unzip it somewhere on your hard drive.

I read this doc, but it did not work. Well that’s why I am writing this. Read on.

3. On your desktop screen, right-click anywhere and new

Right-click the new shortcut then click properites.

Click 'Advanced' at the bottom right. Then tick a box for 'Run as administrator'.

Now when you are using this cmd, you are running it as administrator.

4. Open this cmd and go to the Django folder which you unzipped.

For me

c:\>cd Users\myname\Download\Django-1.2.1\Django-1.2.1

This will takes me to

c:\Users\myname\Download\Django-1.2.1\Django-1.2.1>

Then type the following

c:\Users\myname\Download\Django-1.2.1\Django-1.2.1>c:\Python25\python.exe setup.py install

Check it if it worked by opening start

>>> import django
>>> print django.VERSION

This will add a folder diango and a files called Django-1.2.1-py2.5.egg-info in c:\Python25\Lib\site-pakcages\.

5. In order to create a test folder, create a folder called c:\Users\myname\Django.

Then in you cmd, change to the directory which you just made and type this.

c:\Python25\python.exe c:\python25\Lib\site-packages\django\bin\django-admin.py startproject myapps

This will create a folder called c:\Users\myname\Django\myapps and files in this folder to start your test project.

Go to the directory you created and enter the following in cmd.

python manage.py runserver

This will add some more files. Go to http://127.0.0.1:8000 in your browser to see what you have done so far.

By setting your shell’s PATH environment variable to include Python’s install directory, it is easier to type in cmd.
For example instead of c:\Python25\python.exe …, you can just type python ….

python c:\python25\Lib\site-packages\django\bin\django-admin.py startproject mysecondapps

This will create another folder in your Django folder.

In order to add PATH in Windows Vista,
go to Start>right-click Computer>Properties.
Then click ‘Advanced system settings’ on the left.
It will open a pop-up.
Click ‘Continue’ to allow it.
Then click ‘Environment variables’ at the bottom.
Click ‘New’ and enter PATH for ‘variable name’ and c:\Python25\ for ‘Variable value’.

Resource

Excellent free online book.

10 comments to How to install Django in Python on Windows Vista

  • Josep

    why u change topic to Django, I like if u still write about codeigniter. :)

  • shinokada

    @Josep: I will write more about Codeigniter. :-)

  • I’m new for Django. This is very helpful for me to get started for Django. Thanks shinokada!

  • Where is your new post ?
    I miss your gret post :) let’s write again please…

  • shinokada

    I finished my new app long time ago, but I am bit busy, tired and lazy. Sorry sorry sorry.

  • scott

    thanks, I had trouble installing Django on windows 7 – many other instructions did not work, thanks for the post.

  • Peter

    thanks! This is very helpful

  • This is exactly what I’m looking for. I’m been trying to install Django in my Windows 7 for a long time and all I get was frustrations after another. Thank you very much! If you don’t mind I’d like to ask, do you have any idea on how I can, sort of, integrate Python with PHP? Again thank you very much!

  • balu

    Hi Boss…..Thank you very much.
    With in minutes of time i completed my python and Django successfully by following your Guide…..

    ******************Thank you very much******************************

  • Murugesan

    Thanks for your guidance. I am starting django with your guidance.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>