Django is completely based on Python. Because of that, Python has to be installed first.
Django 1.4.1 supports the Python versions 2.5, 2.6 and 2.7. If you got an older version, you should update it. Django 1.5 will drop Python 2.5 but have experimental Python 3.3 support.
You can check your Python version by starting the Python interpreter in the command line with the option -V.
$ python -V
Python 2.6.1
If you already got the right version, you can proceed with the installation of the Python package manager.
Most Linux distributions have Python pre-installed. If not, you can usually install it with the package manager.
As an alternative, you can download the Python sources and compile it by your own.
Python uses it’s own package system to distribute and install Python packages. Because we will need some of them, we need to install the package manager beforehand.
First step is to install distribute, a replacement for setuptools, which may be already installed on some systems.
There is a bootstrap script to ease installation:
$ wget http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
Note
Root privileges may be required on Linux or Mac OS X.
The package installation is done by pip, a replacement for easy_install which brings more features. However pip itself has to be installed with easy_install:
$ easy_install pip
If easy_install isn’t available, pip can also be installed with a bootstrap script:
$ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py
Note
Root privileges may be required on Linux or Mac OS X.
You can test pip after the installation:
$ pip --version