Opened 9 years ago

Closed 9 years ago

#12591 closed (fixed)

django.contrib.gis.utils.srs is out of date

Reported by: Charlie DeTar Owned by: nobody
Component: GIS Version: master
Severity: Keywords: srs add_postgis_srs
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


django.contrib.gis.utils.srs.add_postgis_srs fails with the following error:

ImportError                               Traceback (most recent call last)
/usr/local/lib/python2.6/dist-packages/django/contrib/gis/utils/srs.pyc in add_postgis_srs(srs, auth_name, auth_srid, ref_sys_name)
     22                    determined by GDAL.
     23     """
---> 24     from django.contrib.gis.db.backend import SpatialBackend
     25     from django.contrib.gis.models import SpatialRefSys
     26     from django.contrib.gis.gdal import SpatialReference

ImportError: No module named backend

This is because the django.contrib.gis.db.backend module no longer exists (it has been renamed "backends"), and the SpatialBackend class is no longer defined.

Thus the following instructions in geodjango documentation fail:

Change History (1)

comment:1 Changed 9 years ago by jbronn

Resolution: fixed
Status: newclosed

(In [12228]) Fixed #12591 -- Renamed add_postgis_srs to add_srs_entry (keeping backwards-compatible alias), added database keyword for multi-db, removed deprecated SpatialBackend references; no longer use get_or_create and look for existing entry based on SRID value.

Note: See TracTickets for help on using tickets.
Back to Top