我在Heroku上收到以下错误:
django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".
这很奇怪,因为它以前曾在工作。
我将buildpack设置为https://github.com/dulaccc/heroku-buildpack-geodjango/。
在我的settings.py中,我有:
GEOS_LIBRARY_PATH = environ.get('GEOS_LIBRARY_PATH')
GDAL_LIBRARY_PATH = environ.get('GDAL_LIBRARY_PATH')
当我部署到Heroku时,似乎找到了GEOS。这是日志:
-----> Checking for GEOS
Installed
GEOS installed and accessible with env variable 'GEOS_LIBRARY_PATH'
-----> Checking for Proj.4
Installed
Proj.4 installed and accessible with env variable 'PROJ4_LIBRARY_PATH'
-----> Checking for GDAL
Installed
GDAL installed and accessible with env variable 'GDAL_LIBRARY_PATH'
最佳答案
此错误是由于安装目录路径不正确所致。 heroku-geo-buildpack的此fork在其最新提交中更正了此问题。
https://github.com/Tekco/heroku-geo-buildpack