How to install Django 1.6?
Solution 1:
While you can install it manually (setup.py
), I recommend using the Python package manager as it is easier to install, maintain and upgrade.
-
Install Pip, the Python package manager.
sudo apt-get install python-pip
-
Optionally, but recommended, upgrade
pip
, using itself:sudo pip install -U pip
-
Install the latest stable version of Django:
sudo pip install Django
This installs 1.6.2 at the time of writing(check here the latest pypi version).
To install a specific version, add a requirement specifier like this:
sudo pip install Django==1.6.2
Note that APT, the Debian/Ubuntu package management will still report the older version installed and it is still installed as well. APT installs in dist-packages paths while Pip installs in the site-packages paths. The latter takes precedence, so that's locally installed packages will be chosen. See also: What's the difference between dist-packages and site-packages?
Solution 2:
First remove the previously installed django 1.3.1 version by deleting the django
folder inside /usr/local/lib/pythonx.x/dist-packages
(x.x denotes the version of python).Then follow the below steps,
Download Django 1.6 from here.
-
Open the terminal and move to the directory where you placed the
Django 1.6
.cd path/to/driectory/which/contains/django1.6.tar.gz
-
Extract the
django1.6.tar.gz
by running the below command.tar -xzvf Django-1.6.tar.gz
-
Move to the
Django-1.6
directorycd Django-1.6
-
Run the below command to install
Django-1.6
sudo python setup.py install