正在運行的Django應用程序通過django-geojson將GeoJSON數據存儲在其中一個模型中。在管理界面中,此字段可通過django-leaflet進行編輯。當我在本地運行應用程序./manage.py runserver
時,界面工作正常,頁面看起來像這樣。Heroku上缺少GDAL
然而,當我部署到Heroku的,它建立得很好,並且在管理界面中打開同一個位置情況下,藍色標記不是任何地方在地圖上,地圖加載正常,並我得到交付給我這個錯誤:
Error creating geometry from value '{
"coordinates":[
"-105.2449000",
"40.0474000"
],
"type":"Point"
}' (Initializing geometry from JSON input requires GDAL.)
我只是在我的models.py
from djgeojson.fields import PointField
from django.db import models
class Location(models.Model):
"""
A model subclass for recording geographic data.
"""
service_id = models.CharField(max_length=255, blank=True, null=True)
name = models.CharField(max_length=255, blank=True, null=True)
geom = PointField() # GeoJSON (remember, coordinates: [long, lat])
def __str__(self):
return self.name
釷記錄單點數據是我第一次使用geoJson,Leaflet和Heroku。我是否遺漏了一些依賴項,是否有一些我忽略的Heroku配置?這是我的requirements.txt
。
dj-database-url==0.4.1
Django==1.10
django-filter==0.13.0
django-geojson==2.9.0
django-leaflet==0.18.1
gunicorn==19.6.0
httplib2==0.9.2
jsonfield==1.0.3
oauth2==1.9.0.post1
oauthlib==1.1.2
psycopg2==2.6.2
PyJWT==1.4.1
python-openid==2.2.5
requests==2.10.0
requests-oauthlib==0.6.2
six==1.10.0
wheel==0.24.0
whitenoise==3.2