Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#13070 closed (fixed)

Wrong exception on django.contrib.gis from SVN

Reported by: Guilherme Gondim (semente) <semente@…> Owned by: nobody
Component: GIS Version: dev
Severity: Keywords: geodjango
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi guys, I can't use the gis app with Django trunk. The same project works fine with Django 1.1.

See the traceback: http://dpaste.com/hold/170253/

Change History (8)

comment:1 by Guilherme Gondim (semente) <semente@…>, 15 years ago

comment:2 by Russell Keith-Magee, 15 years ago

Resolution: invalid
Status: newclosed

Closing invalid. I don't deny there's a problem, but a stack trace and the comment "can't use gis" doesn't help us reproduce it. Reopen if you care to provide *specific* details on how to reproduce the problem.

comment:3 by Guilherme Gondim (semente) <semente@…>, 15 years ago

Resolution: invalid
Status: closedreopened

Sorry... follow more info.

How reproduce the bug:

cd /tmp
django-admin.py startproject geodjangotest
cd geodjangotest
wget http://www.gaia-gis.it/spatialite/init_spatialite-2.3.sql.gz
gunzip init_spatialite-2.3.sql.gz
spatialite spatialite.db < init_spatialite-2.3.sql

Then setup your settings.py with the follow settings:

...

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'spatialite.db'

...

INSTALLED_APPS = (
    ...
    'django.contrib.gis',
)

Try now run ./manage.py syncdb. Occurs this exception:

  ...
  File "/home/semente/.local/lib/python/site-packages/django/db/__init__.py", line 75, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/home/semente/.local/lib/python/site-packages/django/db/utils.py", line 92, in __getitem__
    conn = backend.DatabaseWrapper(db, alias)
  File "/home/semente/.local/lib/python/site-packages/django/contrib/gis/db/backends/spatialite/base.py", line 33, in __init__
    self.ops = SpatiaLiteOperations(self)
  File "/home/semente/.local/lib/python/site-packages/django/contrib/gis/db/backends/spatialite/operations.py", line 128, in __init__
    (self.connection.settings_dict['NAME'], msg))
django.core.exceptions.ImproperlyConfigured: Cannot determine the SpatiaLite version for the "sqlite3.db" database (error was "no such function: spatialite_version").  Was the SpatiaLite initialization SQL loaded on this database?

The same procedure works with Django 1.1.

Software versions:

SpatiaLite version ..: 2.3.0    Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork       [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 Rel. 4.6.1, 21 August 2008
GEOS version 3.1.0-CAPI-1.5.0

...and pysqlite 2.5.6 with load extension support and sqlite3 3.6.16. Ubuntu 9.10 Karmic.

comment:4 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

If this is a regression, it needs to be addressed for 1.2

comment:5 by steveed, 15 years ago

I was unable to reproduce this error:

I am using:
Xubuntu 9.10
Django version 1.2 beta 1 SVN-12855
sqlite 3.6.16
spatialite 2.3.0

comment:6 by Guilherme Gondim (semente) <semente@…>, 15 years ago

Well, on Ubuntu 10.04 Lucid I have the same problem. What is your pysqlite version?

comment:7 by jbronn, 15 years ago

Resolution: fixed
Status: reopenedclosed

(In [12882]) Fixed #13070 -- Introduced fallback code to detect SpatiaLite 2.3.0 versions (which do not have spatialite_version function).

comment:8 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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