3

I want to filter results according to their distance so I used GeoDjango and added a field PointField to my model:

from django.contrib.gis.db import models

location = models.PointField(u"longitude/latitude",
                                 geography=True,
                                 blank=True,
                                 null=True)

However, I have this error in my browser when trying to launch the index (my web site)

ImproperlyConfigured at /
The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 1.10.6
Exception Type: ImproperlyConfigured
Exception Value:    
The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.
Exception Location: /Users/mac/ostadienv/lib/python3.5/site packages/django/contrib/gis/db/backends/spatialite/base.py in get_new_connection, line 52
Python Executable:  /Users/mac/ostadienv/bin/python
Python Version: 3.5.0

and this in python:

'The pysqlite library does not support C extension loading. '
django.core.exceptions.ImproperlyConfigured: The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.

I'm working on a MAC.

John Moutafis
  • 22,254
  • 11
  • 68
  • 112
A2maridz
  • 341
  • 1
  • 4
  • 11
  • Did you follow the instructions here: https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/spatialite/#mac-os-x-specific-instructions ? – Udi Mar 30 '17 at 09:57
  • Yes I did, but it does not work – A2maridz Mar 30 '17 at 10:13
  • When I tape 'brew install geos' I get this Warning: geos-3.6.1 already installed, it's just not linked. are there any relation between them – A2maridz Mar 30 '17 at 10:14

0 Answers0