Django:按距离排序,spacealite不加载C扩展

2024-04-25 00:06:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我想根据距离过滤结果,所以我使用了GeoDjango并在模型中添加了一个字段PointField

from django.contrib.gis.db import models

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

但是,当我试图启动索引(我的网站)时,我的浏览器出现了这个错误

^{pr2}$

在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.

我正在研制MAC电脑。在


Tags: thetodjangotrue距离supportmodelsextension