Installing Django on your system is very easy. As it is just Python, you will only need a small effort to get it up and running on your machine. We will do it in two easy steps:
The only thing you need on your system to get Django running is obviously Python. At the time of writing this book, the latest version available is the 1.5c1 (release candidate) and it works on all Python versions from 2.6.5 to 2.7, and it also features experimental support for Version 3.2 and Version 3.3.
Get the right Python package for your system at http://www.python.org. If you are running Linux or Mac OSX, Python is probably already installed in your operating system.
Note
If you are using Windows you will need to add the path of the Python installation folder (C:\Python27
) to the environment variables.
You can verify that Python is installed by typing python
in your shell. The expected result should look similar to the following output:
Python 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
Now we will see two methods to install Django: through a Python package manager tool called pip and the manual way. Feel free to use the one that you prefer.
Note
At the time of writing this book the Django Version 1.5 is in the release candidate status, if this is still the case jump to the manual installation step and download the 1.5 release candidate package in place of the last stable one.
Install pip; the easiest way is to get the installer from http://www.pip-installer.org:
If you are using a Unix OS execute the following command:
$ sudo pip install Django
If you are using Windows you will need to start a shell with administrator privileges and run the following command:
$ pip install Django
Download the last stable release from the official Django website https://www.djangoproject.com/download/.
Uncompress the downloaded file using the tool that you prefer.
Change to the directory just created (
cd Django-X.Y
).If you are using a Unix OS execute the following command:
$ sudo python setup.py install
If you are using Windows you will need to start a shell with administrator privileges and run the command:
$ python setup.py install Django