Opened 9 years ago

Closed 9 years ago

#24066 closed Bug (needsinfo)

Django 1.6 Postgis 2.x detection broken

Reported by: Matthias84 Owned by: nobody
Component: GIS Version: 1.6
Severity: Normal Keywords: postgis detection
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi, I realy enjoy (geo)Django to rapidly develop smal GIS applications for some time now. Unfortunatly, I guess I found a bug:

If you install Django and try to add GIS functionality thanks to Postgres+PostGIS, django seems to be unable to detect PostGIS correctly and reports at syncdb and similat commands:

Cannot determine PostGIS version for database "django_geotest". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

There is a workaround by faking the postgis version manually, that work for me: https://stackoverflow.com/questions/10584852/my-postgis-database-looks-fine-but-geodjango-thinks-otherwise-why

My setup:

  • Linux Mint 17
  • Python 2.7 and venv
  • Django 1.6.8
  • Postgres 9.3 and PostGIS 2.1 following the official tutorial

Change History (3)

comment:1 by Tim Graham, 9 years ago

Could you please try with Django 1.7.1? Django 1.6 is only receiving security updates, so if this issue is fixed in 1.7, we can close this ticket.

comment:2 by Claude Paroz, 9 years ago

To be sure it's not an unknown issue, could you please try to debug the error raised by postgis_version_tuple() located in django/contrib/gis/db/backends/postgis/operations.py?
It could also be triggered by running the following at a Django shell:

from django.db import connection
print(connection.ops.postgis_version_tuple())

comment:3 by Claude Paroz, 9 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top