Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

These instructions are a draft.

Download, Build, Install PostGIS

Follow the instructions at http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS15Ubuntu1004src to retrieve, build and install version 1.5 of PostGIS.

Build The Template

Ignore the instructions on that page. Instead:

Log directly into the postgres user using

  sudo -i
  su - postgres

Create a database template that uses PostGIS:

	createdb -E UTF-8 --locale=en_US.UTF-8 template_postgis  -T template0
	createlang plpgsql template_postgis
	psql -d template_postgis -c "UPDATE pg_database SET datistemplate=true WHERE datname='template_postgis'"
	psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis.sql
	psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql
	psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis_comments.sql

Exit the postgres user:

exit
exit

Note: in these instructions, the template name is template_postgis
You can choose any template name you like, but you will need to use your particular template name where appropriate when creating a database from the template.

Update development.py

In your project/development.py file, update the "ENGINE" of your default database definition:

DATABASES = {
    'default': {
        'NAME': 'oercommons_db',
        'ENGINE': 'django.contrib.gis.db.backends.postgis', # <== Update this value
        'USER': '',
        'PASSWORD': ''
    }
}
  • No labels