================================
How to install Django on Windows
================================
This document will guide you through installing Django and Python for
basic usage on Windows. This is meant as a beginners guide for users doing
development of Django projects and does not reflect how Django should be
installed for production environments.
Install Python
==============
Django is a Python web framework, thus requiring Python installed on your
machine.
To install Python on your machine go to http://python.org/download/, and
download a Windows MSI installer for Python 2.x (eg. 2.7.1). Django does not
currently run on Python 3.x. lSee the :doc:`the Django FAQ `
for more information.
Once downloaded, run the MSI installer and follow the on screen instructions.
Install Setuptools
~~~~~~~~~~~~~~~~~~
To install other python software on your computer, setuptools is needed.
Download the latest installer for your Python version from
http://pypi.python.org/pypi/setuptools#files. Run the installer and follow
the on screen instructions.
Adding Python to PATH
~~~~~~~~~~~~~~~~~~~~~
To be able to execute Python, and related scripts, the directory where
you installed Python, and the *Scripts* sub directory,
must be on PATH. Only the approach for Windows 7 will be explained,
but the other versions of Windows have similar approaches.
* Click the Windows button.
* Right click on *Computer* and choose *Properties*.
* Click *Advanced System Settings* at the bottom of the list on the left side
of the opened window.
* Click *Environment Variables* at the bottom
* Find the *Path* variable in the list of *System variables*,
select it and click the *Edit...* button.
* The *Variable value* is a semi colon separated list of directories. Make
sure both the install directory and the *Scripts* directory is in this list.
If not, add them to the end of the list (*C:\\Python27;
C:\\Python27\\Scripts*)
* Click *OK* to save the changes.
Install PIP
===========
`PIP `_ is a package manager for Python that
uses the `Python Package Index `_ to install Python
packages. PIP will later be used to install Django from PYPI.
* Open a command prompt. If you installed Python to a directory where only
administrators have write access, the command prompt need to be run as an
administrator user.
* Execute the following command ``easy_install pip``
PIP should now be installed.
Database
========
From Python version 2.5 SQLite is included in the package. This means that, for
local development, it is normally not needed to install other databases. If
you want to use another database, like PostgreSQL, MySQL etc.,
you are free to install it as well.
Install Django
==============
Finally Django can be installed quite easily with PIP.
In the same command prompt that you used to install PIP,
execute the following command: ``pip install django``. This will download and
install Django.
After the installation has completed, you can verify your Django installation
by execution ``django-admin.py --version`` in the command prompt.
Common pitfalls
===============
* If ``django-admin.py`` only displays the help text, no matter what arguments
it is given, there are probably a problem with the file association in
Windows. See the solution on `Stackoverflow `_