Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgis / Geodjango: Cannot determine PostGIS version for database

I'm attempting to launch a GeoDjango app. I've installed Postgres & PostGIS using brew on Lion. I created a database using template_postgis: createdb -T template_postgis test.

When I run python manage.py syncdb, I get the following error:

django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "test". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

How can I track down the source of the error? I've checked that the user & pass in the config have access to the database etc.

like image 757
Matt Hampel Avatar asked Sep 20 '11 21:09

Matt Hampel


People also ask

Is PostGIS a database?

PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.

Does PostGIS come with PostgreSQL?

However, Postgres. app has been adding support for other extensions, and now comes with support for PostGIS, PLV8 and MVT already built in. If you want PgRouting, you can use Homebrew to install the dependencies it needs, and build it from source.


1 Answers

Just add in your settings.py your right version of postgis :

POSTGIS_VERSION = (2, 0, 3)

like image 166
David Avatar answered Oct 14 '22 01:10

David