Skip to content

Install django using virtualenv in ubuntu

January 5, 2010
tags: ,

Install virtualenv and pip as system packages.


$ sudo aptitude install python-pip
$ sudo aptitude install python-virtualenv python-setuptools

Virtualenv

Create virtualenv workspace.


$ virtualenv --no-site-packages trackedfm
New python executable in trackedfm/bin/python
Installing setuptools............done.

Django

Install django into the workspace.


$ pip -E trackedfm/ install -U django
Downloading/unpacking django
Downloading Django-1.1.1.tar.gz (5.6Mb): 5.6Mb downloaded
Running setup.py egg_info for package django
Installing collected packages: django
Running setup.py install for django
changing mode of build/scripts-2.6/django-admin.py from 644 to 755
changing mode of /home/paul/workspace/python/trackedfm/bin/django-admin.py to 755
Successfully installed django

Virtualenvwrapper

virtualenvwrapper provides shortcuts for switching between virtual environments. Install virtualenvwrapper using easy_install.

$ sudo easy_install virtualenvwrapper

Configure shell

Add two lines to your .bashrc to set the location where the virtual environments should live and the location of the script installed with this package:

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

Switching between projects

Resources

Advertisement
No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.