Wednesday, April 23, 2014

Installing Django on Windows 8

First, install python, preferably the newest working version for Django.
make sure the option to install python to PATH is selected. On default  it is not selected.

Next, add or make sure python is in your PATH.
Go to Computer.
Right click and select Properties.
Next, go to environment variables and look for the variable which says PATH.
Edit it by adding C:\Python34 and C:\Python34\Scripts
Next, open PowerShell.
Type python in the shell. It will show you the python version that is installed.
 
Now install get-pip.py.
Download it then open PowerShell again.
Then change cd Downloads because you're likely in your home folder and you downloaded get-pip.py into your downloads folder.
Once there, enter the command python get-pip.py. This might take awhile.  It will also install setuptools for you if your computer does not have it yet.
 
Then install Django via pip.
In PowerShell, enter pip install django.
Then pip should install Django for you.

To start your first Django project in the powershell prompt, type:
django-admin startproject projectName


If you have python associated with another version of python then django-admin might not work for you.
You'll have to change the file associations within regedit, root, python, shell, open, command

Potentially install virtualenv to also deal with different versions
 
Alternate instructions from the Django site are also here: https://docs.djangoproject.com/en/dev/howto/windows/