Index: db/backend/postgis/creation.py =================================================================== --- db/backend/postgis/creation.py (revision 1) +++ db/backend/postgis/creation.py (working copy) @@ -37,6 +37,11 @@ # Constructing the necessary SQL to create the database (the DATABASE_USER # must possess the privileges to create a database) create_sql = 'CREATE DATABASE %s' % connection.ops.quote_name(db_name) + + # use the postgis template to create the spatial db with necessary sp's + if hasattr(settings, 'POSTGIS_TEMPLATE'): + create_sql += ' TEMPLATE %s' % settings.POSTGIS_TEMPLATE + if settings.DATABASE_USER: create_sql += ' OWNER %s' % settings.DATABASE_USER