Code


Version 5 (modified by anonymous, 8 years ago) (diff)

--

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.