#13070: Wrong exception on django.contrib.gis from SVN
------------------------------------------------------------------------+---
          Reporter:  Guilherme Gondim (semente) <[email protected]>  |       
  Owner:  nobody   
            Status:  reopened                                           |     
Milestone:  1.2      
         Component:  GIS                                                |       
Version:  SVN      
        Resolution:                                                     |      
Keywords:  geodjango
             Stage:  Unreviewed                                         |     
Has_patch:  0        
        Needs_docs:  0                                                  |   
Needs_tests:  0        
Needs_better_patch:  0                                                  |  
------------------------------------------------------------------------+---
Changes (by Guilherme Gondim (semente) <[email protected]>):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 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.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13070#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to