Running Multiple Django Versions in Development

I have needed to use different revisions of the django trunk at different points in time (in testing locally a new revision before upgraded in production, or working on two different projects that deploy to two different production environments, etc).

There may be a better way, but how I have handled it pretty painlessly is by running this script:

`

!/bin/bash

rm -rf /[YOUR PATH]/$1 svn co -r $1 http://code.djangoproject.com/svn/django/trunk/django /[YOUR PATH]/$1 sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/django sudo rm /usr/bin/django-admin sudo ln -s /[YOUR PATH]/$1/ /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/django sudo ln -s /[YOUR PATH]/$1/bin/django-admin.py /usr/bin /django-admin echo "Switched to" $1 `

It takes a single parameter, a revision number.

./switch.sh 7000

I run this script from within a directory in my home directory called "django".

You will likely need to change the paths in the script above if you are not running Python 2.5 on Mac OSX. Also, remember to substitute "[YOUR PATH]" for the base location of where you want to store the django code.