| Version 7 (modified by , 20 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:$PATHandexport MANPATH=/usr/local/man:$MANPATHto~/.profile - Open a new terminal session
- Type
pythonand 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:$PATHandexport MANPATH=/usr/local/pgsql/man:$MANPATHto~/.profile - Add
export PGDATA=/usr/local/pgsql/datato~/.profileNOTE: If this isn't set, postgres will complain about a missing conf file. - Open a new terminal session
- Type
psql -Vand 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 $PGDATANOTE:sudomeans substitute user and do, and in this case with the initial-uparameter, 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 buildsudo python setup.py installDownload the latest stable tarball of psycopg1export MACOSX_DEPLOYMENT_TARGET=10.4export 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)makesudo make install- Run
python, typeimport psycopginto the interactive read-eval-print loop (REPL), andquitthe REPL.
Note:
See TracWiki
for help on using the wiki.