SQLObject - OS/X

by jesse in ,

Building on my SQLObject post from Yesterday I figured out spit out my notes from setting SQLObject up on my Powerbook (with Postgresql). Now, you'll need to satisfy some dependencies first - I'm doing this from the point of view of getting it to work with PostgreSQL - not any of the other DBs it supports.

Grab the postgres distribution from: PGSQL For Mac This distribution is nice, as it contains an installer, as well as a control panel and other utilities for postgresql. It's convenient for "1 click Setup" This package installs everything in /Library/PostgreSQL8/

Once that's done, you'll need to install MX Date Time (Get the Source .tar.gz) (This is a Psycopg dependency). Because the version of SQLObject I am using does not support the latest rev of psycopg, I had to fall back to version 1 of psycopg, which forced my to pull in MX Date time.

Setting up MXDateTime is a simple affair of grabbing that source tarball, unpacking it, cd'ing into the directory and doing a sudo python setup.py install

With that done, you need to download and install Psycopg version 1 - version 2 won't work. You can grab it from here.

After unpacking it, you'll need to do a special ./configure line - like this:

(this is all 1 line!) ./configure --with-postgres-libraries=/usr/local/pgsql/lib --with-postgres-includes=/usr/local/pgsql/include --with-mxdatetime-includes=/System/Library/Frameworks/Python.framework/ Versions/2.3/lib/python2.3/site-packages/mx/DateTime/mxDateTime

Then do a make, and an sudo make install

Now it's time to download SQLObject from here (I grabbed the source tarball. Unpack that zip, and do the normal sudo python setup.py install If it prompts you, let it download setuptools.

Viola! You should now be ready to start the postgres server (after poking a hole in the OS/X firewall for port 5432) and make a new database, or simply pick up the handy SQL Object Docs.