Skip to content

Installing python and django locally

klfd4 edited this page Jun 23, 2011 · 3 revisions

The guide assumes the install path is ${HOME}. This will create bin and lib directories in your users home directory.

Setting up environment variables

Put this in .bashrc

# Important that this new bin-directory is set first
export PATH=${HOME}/bin:$PATH 
# devilry spesific variable
export DJANGO_SETTINGS_MODULE=devilry.projects.dev.settings 

Setting up Python 2.7.2

99% of Devilry works on Python 2.5.x (which is the version installed globally at IFI), but the last bit only works from 2.7.2.

$ cd /tmp
$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
$ tar jxvf Python-2.7.2.tar.bz2
$ cd Python-2.7.2
$ ./configure --prefix=${HOME}
$ make
$ make install

Test it!

$ python --version
Python 2.7.2

Setting up Django 1.3

$ cd /tmp
$ wget http://www.djangoproject.com/download/1.3/tarball/
$ tar zxvf Django-1.3.tar.gz
$ cd Django-1.3
$ python setup.py install  

Now django should be accessible for python. Test it!

$ python
Python 2.7.2 (default, Jun 20 2011, 10:37:08) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
'1.3'

Lastly, make a symlink to django-admin.py so you don't have to specify the full path every time you want to run them

$ cd ${HOME}/bin
$ ln -s ${HOME}/lib/python2.7/site-packages/django/bin/django-admin.py django-admin.py

Setting up Docutils

Docutils is needed to run the tests in Devilry.

$ cd /tmp
$ wget http://pypi.python.org/packages/source/d/docutils/docutils-0.7.tar.gz#md5=9aec716baf15d06b5aa57cf8d5591c15
$ tar zxvf docutils-0.7.tar.gz
$ cd docutils-0.7
$ python setup.py install