Version 1 (modified by Jacob, 19 years ago) ( diff )

Moved page from badly titled "Development" page (and cleaned up formatting)

Development (Mac OS X Tiger)

These instructions are for Django 0.91. I hope to update this with most new releases.

I prefer the latest tarballs for general development. If I ever start to get really into the software I get the CVS or SVN.

Before beginning, install XCode. XCode contains make, gcc, and other things you'll be needing when compiling from source.

Installing Python

  1. Download and unpack latest stable python tarball
  2. ./configure --prefix=/usr/local; make; make install
  3. Add export PATH=/usr/local/bin:$PATH and export MANPATH=/usr/local/man:$MANPATH to ~/.profile
  4. Open a new terminal session
  5. Type python and check that it is the version you just installed

Installing \PostgreSQL

  1. Create a new user, _postgres_ in the Accounts Pane of the Mac OS X System Preferences
  2. Download and unpack latest stable \PostgreSQL tarball
  3. ./configure --prefix=/usr/local/pgsql; make; sudo make install
  4. Add export PATH=/usr/local/pgsql/bin:$PATH and export MANPATH=/usr/local/pgsql/man:$MANPATH to ~/.profile
  5. Add export PGDATA=/usr/local/pgsql/data to ~/.profile NOTE: If this isn't set, _postgres_ will complain about a missing conf file.
  6. Open a new terminal session
  7. Type psql -V and check that it is the version you just installed
  8. Create a data directory: sudo mkdir $PGDATA
  9. Change ownership to postgres: sudo chown postgres:postgres $PGDATA
  10. Create the initial data area: sudo -u postgres initdb -D $PGDATA NOTE: sudo means _substitute user and do_, and in this case with the initial -u parameter, we are telling sudo to run the command as _postgres_ rather than _root_.
  11. To run the database (will not be automatically started on boot): sudo -u postgres pg_ctl start
  12. Open a new window, and type sudo -u postgres createdb test. If it says CREATE DATABASE, it's working. :)

Installing psycopg (\PostgreSQL Bindings)

At the time of this writing, the only stable version of _psycopg_ is _psycopg1_. The development version _psycopg2_ is not supported by Django.

  1. Download the latest stable tartball of _[mxDateTime](http://www.egenix.com/files/python/mxDateTime.html)_
  2. Unpack the tarball and go into the directory
  3. python setup.py build
  4. sudo python setup.py install
  5. Download the latest stable tarball of psycopg1
  6. export MACOSX_DEPLOYMENT_TARGET=10.4
  7. export CPPFLAGS="-I/usr/local/lib/python2.4/site-packages/mx/DateTime/mxDateTime"
  8. ./configure --with-postgres-libraries=$(pg_config --libdir) --with-postgres-includes=$(pg_config --includedir)
  9. make
  10. sudo make install
  11. Run python, type import psycopg into the interactive read-eval-print loop (REPL), and quit the REPL.
Note: See TracWiki for help on using the wiki.
Back to Top