我试图设置一个GeoDjango应用程序来测试我正在测试的an earlier problem。我已经设置了PostgreSQL数据库,创建一个新的Django项目和应用程序,但是当我尝试./manage.py syncdb
我得到这个:我的PostGIS数据库看起来不错,但GeoDjango认为不然......为什么?
django.core.exceptions.ImproperlyConfigured:无法确定数据库“django_geotest”的PostGIS版本。 GeoDjango至少需要PostGIS版本1.3。数据库是从空间数据库模板创建的吗?
这正如我先前通过全部安装GeoDjango内置的要求是,而且做这个创造了这个django_geotest
数据库我不明白:
$ createdb -T template_postgis django_geotest
它看起来像数据库是正确的设置:
django_geotest=# SELECT PostGIS_full_version();
postgis_full_version
-------------------------------------------------------------------------------------------------------
POSTGIS="1.5.3" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS
(1 row)
描述的数据库,我得到这个:
django_geotest=# \d
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+-------
public | geography_columns | view | phil
public | geometry_columns | table | phil
public | spatial_ref_sys | table | phil
(3 rows)
所以现在我坚持下一步要做什么......我对postgresql及其模板等的了解并不是很好。有任何想法吗?谢谢。
的
postgis_lib_version
通话之前我有同样的问题,但我想不出我如何解决它。我想我试过这个:http://stackoverflow.com/questions/5907672/installation-error-while-trying-to-install-a-gis-application-using-geodjango – dannyroa与PostgreSQL 9.3和PostGIS 2.1有同样的问题使用自制软件安装在OS X 10.9.1上,我只需要将'POSTGIS_VERSION =(2,1)'添加到'settings.py'。它根本无法读取设置 – BenjaminGolder
@BenjaminGolder - 解决了我的问题以及...建议它应该是正确的答案? – Erve1879