Update Jan 19, 2012
I have an existing django app I have been working on. I want to now move from the sqlite dev database I have been using to a postGIS data. I am on the same machine as I used to preform the steps below so the libraries should already be installed. Also I do not need to rerun the template script.
I first create a database for my app named dev_bb
createdb -T template_postgis dev_bb
Then I source my vertualenv and try to syncdb and get the following error.
File "/home/wilblack/virtualenvs/bb_env/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 24, in
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
It looks like python cannot see psycopg2 because it is installed outside the virtualenv. Pip to the rescue. A simple
and I’m back in business.
I just got done installing PostGIS 8.4 on my Ubuntu 10.04 Server. apt-get makes this process very simple.