This is what I use for PostgreSQL and psycopg2 installation with
Buildout:

First, adjust the eggs to pull-in a custom-built psycopg2 egg:

eggs = ${psycopg2:egg}
       ${buildout:eggs}

Then for psycopg2 do:

[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs = ${postgresql:location}/include
library-dirs = ${postgresql:location}/lib

The ${postgresql:location} can alternately be pointed to an existing
PostgreSQL install. Or I sometimes use a ${shared-location:path} which
I set in my ~/.buildout/default.cfg file if I have a lot of different
apps and don't want a zillion different PostgreSQL installs. Or you
can install PostgreSQL with the 'configure; make; make
install;' (CMMI) recipe:

[postgresql]
recipe = zc.recipe.cmmi
url =
http://wwwmaster.postgresql.org/redir/198/h/source/v8.3.7/postgresql-8.3.7.tar.gz
extra_options =
  --with-readline

And initialize a PostgreSQL database with:

[init-pgsql]
recipe = iw.recipe.cmd
on_install = true
on_update = false
cmds =
  ${postgresql:location}/bin/initdb -D ${postgresql:location}/var/data
-E UNICODE

And create a suite of symlinks to make the PostgreSQL commands
available in your project's ./bin directory with:

[pgsql-symlinks]
recipe = cns.recipe.symlink
symlink_target = ${buildout:directory}/bin
symlink_base = ${postgresql:location}/bin
symlink =
  clusterdb
  createdb
  createlang
  createuser
  dropdb
  droplang
  dropuser
  ecpg
  initdb
  ipcclean
  pg_config
  pg_controldata
  pg_ctl
  pg_dump
  pg_dumpall
  pg_resetxlog
  pg_restore
  postgres
  postmaster
  psql
  reindexdb
  vacuumdb

Finally, you need to add a find-links pointing to a place where the
psycopg2 package can be found, since it hasn't actually been released
on PyPI (arg!):

[buildout]
find-links = http://initd.org/pub/software/psycopg/PSYCOPG-2-0/

And for the time being, pin psycopg2 back down to version 2.0.8. This
is because the newer versions prefer a build_ext option pointing to
the 'pg_config' binary, but zc.recipe.egg currently doesn't support
this (a feature enhancement for this recipe which I haven't yet gotten
around to writing, since 2.0.8 works fine for me current needs):

[versions]
psycopg2 = 2.0.8

It can be quite a bit of config-ery, but when you get a complete
working web app with a full database from a single one-push button
install, it's a beautiful thing :)
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to