Python 在ubuntu上安装和使用postgis

Python 在ubuntu上安装和使用postgis,python,django,postgresql,postgis,Python,Django,Postgresql,Postgis,我有一个在django上运行的站点,我正在向其中添加django cities模块 到目前为止,我已经安装了postgresql-9.3-postgis-2.1,并通过运行创建扩展postgis对数据库进行了必要的更改;指挥部 当我运行manage.py syncdb时,会出现以下错误: django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "site_db". Geo

我有一个在django上运行的站点,我正在向其中添加django cities模块

到目前为止,我已经安装了postgresql-9.3-postgis-2.1,并通过运行创建扩展postgis对数据库进行了必要的更改;指挥部

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

django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "site_db". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?
根据我的研究,解决这个问题的一种方法似乎是在settings.py中添加以下内容:

POSTGIS_VERSION = (2, 0, 3)

这是解决问题的正确方法吗?postgis的未来更新不会中断吗?

您可以按照本博客的步骤进行操作:谢谢@ruddra,解决了这个问题。:)