Django on Snow Leopard

Having just been given an new MacBook Pro as an early birthday present, it didn’t take me long to try and install Django on it. Rather than use the MacPorts solution I decided to use the native python 2.6 and build the rest, apart from MySQL (use the Mac OS X 10.5 (x86_64) package from here)

Before proceeding make sure that you have installed XCode (It’s on the Snow Leopard install disc) as we need it to install libjpeg and PIL (all of my Django projects use this!)

Download libjpeg then:

tar -xzf jpegsrc-1.v7.tar
cd jpegsrc-1.v7
ln -s `which glibtool` ./libtool
set env MACOSX_DEPLOYMENT_TARGET 10.6
./configure --enable-shared && make && sudo make install

Now we can download the source and build PIL

tar -xzf Imaging-1.1.6.tar.gz
cd Imaging-1.1.6
sudo python setup.py install

Last thing to do before we install Django is to install the MySqlDb connector – you will need to do add the following to your .bash_profile

PATH="${PATH}:/usr/local/mysql/bin"

Then:

sudo easy_install mysql-python

Now we can easy_install Django:

sudo easy_install django

and we are all set to go :)

Thanks to these guys for the help in figuring this out:
http://dryan.com/
http://www.brambraakman.com/blog/
http://colbypalmer.com/
http://www.agapow.net/

Tags: , , , , ,

2 Responses to “Django on Snow Leopard”

  1. Tim Says:
    October 6th, 2009 at 20:57

    This would have been great this morning!

  2. Nick Says:
    October 21st, 2009 at 00:08

    Wow – thanks for posting this. Works great!

Leave a Reply




Switch to our mobile site