Version 8 (modified by 19 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
- Download and unpack latest stable python tarball
./configure --prefix=/usr/local; make; make install
- Add
export PATH=/usr/local/bin:$PATH
andexport MANPATH=/usr/local/man:$MANPATH
to~/.profile
- Open a new terminal session
- Type
python
and check that it is the version you just installed
Installing \PostgreSQL
- Create a new user, postgres in the Accounts Pane of the Mac OS X System Preferences
- Download and unpack latest stable \PostgreSQL tarball
./configure --prefix=/usr/local/pgsql; make; sudo make install
- Add
export PATH=/usr/local/pgsql/bin:$PATH
andexport MANPATH=/usr/local/pgsql/man:$MANPATH
to~/.profile
- Add
export PGDATA=/usr/local/pgsql/data
to~/.profile
NOTE: If this isn't set, postgres will complain about a missing conf file. - Open a new terminal session
- Type
psql -V
and check that it is the version you just installed - Create a data directory:
sudo mkdir $PGDATA
- Change ownership to postgres:
sudo chown postgres:postgres $PGDATA
- 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. - To run the database (will not be automatically started on boot):
sudo -u postgres pg_ctl start
- Open a new window, and type
sudo -u postgres createdb test
. If it saysCREATE 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.
- Download the latest stable tartball of [mxDateTime](http://www.egenix.com/files/python/mxDateTime.html)
- Unpack the tarball and go into the directory
python setup.py build
sudo python setup.py install
Download the latest stable tarball of psycopg1
export MACOSX_DEPLOYMENT_TARGET=10.4
export CPPFLAGS="-I/usr/local/lib/python2.4/site-packages/mx/DateTime/mxDateTime"
./configure --with-postgres-libraries=$(pg_config --libdir) --with-postgres-includes=$(pg_config --includedir)
make
sudo make install
- Run
python
, typeimport psycopg
into the interactive read-eval-print loop (REPL), andquit
the REPL.
Note:
See TracWiki
for help on using the wiki.