Install multiple Django version using virtualenvwrapper in ubuntu

Hi guys, Are you finding difficulties to install multiple django version and switch between them easily? Here is the way.

We can achieve this by using virtualenv and virtualenvwrapper. virtualenv allows you  to set up multiple isolated Python environments and virtualenvwrapper allows create and manage multiple virtualenv seamlessly.Here is the simple steps to setup

1) Install virtualenv and virtualenvwrapper

    sudo pip install virtualenv virtualenvwrapper
2) Create virtual env directory 

   mkdir ~/.virtualenvs
3) Set enviromental path in .bashrc file

vi .bashrc, add below lines to end of the file.

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/

4) Close your terminal and open new one. Create virtual environment

 mkvirtualenv env1

After the above step you see the terminal something like


Congrates.. Our virutual enviroment is ready and we can now install our Django version under env1,

5) (env1)shabeer@shabeer-Vostro-1400:~$ wget
6) (env1)shabeer@shabeer-Vostro-1400:~$ tar -zxvf Django-1.3.tar.gz
7) (env1)shabeer@shabeer-Vostro-1400:~$ cd Django-1.3
8) (env1)shabeer@shabeer-Vostro-1400:~$ python install
Above step will install django 1.3 under  virtual enviroment env1, and we can access it only by env1.

9) If you want work on django 1.2.5, create another virtual enviroment

mkvirtualenv env2, after this command and promt will be like this


10) Download Django 1.2.5 and follow step 6 to 8.


11) If you want to switch to env1 , run below command

(env2)shabeer@shabeer-Vostro-1400:~$ workon env1

Using above command we can easily switch environment.

Done! Thanks.