我試圖設置一個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