Running Django on OSX

No doubt you've heard about the new python web framework thats making some waves at the moment - Django.

As with most *nix developers, im running OSX (10.4), and wanted to get a working Django dev environment function to have a play around with it and found that a needed to mess around with a few things to get it working, so I thought id post them up here in case anyone else found them usefull :)

Step 1

Download the python-mac installer from here and run it. That will give you a working version of the latest python bin.

Step 2

Checkout the latest version of Django source like so

cd /usr/local

svn co http://code.djangoproject.com/svn/django/trunk/ django

Step 3

If you used the python installer for mac, then the below will work, otherwise, you'll need to just tweak the path's a bit:

ln -s /usr/local/django/django /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django

Step 4

Add the django source to your path:

PATH=/usr/local/django/django/bin:$PATH

Then that should be it :) However, if your a touch on the forgetfull side when using the terminal, it can be annoying having to keep putting the .py on the end of the django commands, so we'll just quickly symlink them so if we forget to add .py, it wont slap us with a kipper

cd /usr/local/django/django

ln -s django-admin.py django-admin

Then your all done! Enjoy Django :)

blog comments powered by Disqus