gpt4 book ai didi

django - Postgis/Geodjango : Cannot determine PostGIS version for database

转载 作者:行者123 更新时间:2023-11-29 11:07:59 29 4
gpt4 key购买 nike

我正在尝试启动 GeoDjango 应用程序。我已经在 Lion 上使用 brew 安装了 Postgres 和 PostGIS。我使用 template_postgis 创建了一个数据库:createdb -T template_postgis test

当我运行 python manage.py syncdb 时,出现以下错误:

django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "test". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

如何追踪错误的来源?我已经检查过配置中的用户和传递是否可以访问数据库等。

最佳答案

只需在您的 settings.py 中添加您正确的 postgis 版本:

POSTGIS_VERSION = (2, 0, 3)

关于django - Postgis/Geodjango : Cannot determine PostGIS version for database,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7491798/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com