Saturday, January 30, 2010

Installing Django 1.0 on OS X Leopard

I'm setting up my Mac as a development host for Nuj.

On linux, my dev setup is emacs, git, django, postgresql, the source tree, and a few scripts. OS X comes with emacs, and git was a simple dmg drag-drop. Django is a bit more complicated.

I'll follow the Quick Install Guide provided by Django.

1. Install Python. OS X comes with Python.

$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
/Library/Python/2.6/site-packages

Django works with Python versions 2.3 to 2.6, so this is fine.

2. Set up a database. Since I have version 2.6 (> 2.5), I can skip this step for now. I'll detail setting up PostgreSQL in a sequel.

3. Remove any old versions of Django. None present.

4. Install Django. The instructions provide three choices, either a distribution supplied version, an official release, or the main development trunk. I don't believe that Apple supplies a version of Django, and that this is relevant for Linux systems. I'd rather not be on the bleeding edge, so that leaves an official release. Clicking through the second option's link drops me onto the installation page and provides four steps:

1. Download the latest official release. Django-1.1.1.tar.gz. Check.

2. Unpack the tarball. That requires a single click on the tarball in the downloads stack.

3. Cd to the directory created by tar.

4. Install with the usual Python idiom:

$ sudo python setup.py install

That, apparently, is it.

No comments:

Post a Comment