How to install a development ready setup of Django on MacOS X 10.4 (Tiger).
Yep, step by step. I took the easiest possible track for installation – installing with SQLite support. Not what you’d probably want to do for any sort of production world, but lovely for quick development.
1) Install MacOS X developer tools.
You can download the tools online from Apple’s ADC site once you’ve registered. You probably have a copy on CD or DVD with your Mac installation media – pop the DVD in and look around for it.
2) Install DarwinPorts
Go to http://darwinports.org/downloads/ and click on the link to download DarwinPorts-1.2.1-10.4.dmg. Obviously this is only if you have MacOS X 10.4. Once it’s downloaded, open the disk image and install the package.
3) Update DarwinPorts and get all the software. Note – this step took about 2 hours on my MacBookPro to grab, compile, and install everything. YMMV.
I used the following commands in order:
sudo port -d selfupdate
sudo port install subversion
sudo port install sqlite3 py-sqlite python24
sudo port install py-docutils py-mx
THIS NEXT BIT IS A VERY IMPORTANT STEP:
You’ll want to add the following environment variables. Open or create the file .bash_profile in your home directory and add the following lines at the end of that file:
Once that’s done, close the terminal window and open a new one. To test to make sure you’ve got the right PATH setup, run the command “python -V”. (thats a capital V). If you see version 2.4.something, you’re good. If you see version 2.3.something then you’re running the built in python and something forward is likely to break. Check the lines above in your .base_profile file to make sure the PATH environment variable is being updated properly.
Download Django for installation. Most folks will tell you to get the trunk from subversion – here’s what I did to get that:
svn co http://code.djangoproject.com/svn/django/trunk django-trunk
sudo python setup.py install
Now you’ve got it installed. Issuing the command “django-admin.py” from the terminal window you have open should do something! (give you messages about how to use it)