我正在尝试将我的 Geo-Django 应用程序部署到 Zappa 1st 我得到
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library
(tried "gdal", "GDAL", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0",
"gdal1.10.0", "gdal1.9.0"). Is GDAL installed? If it is, try setting
GDAL_LIBRARY_PATH in your settings.
然后我点击此链接并添加了以下内容
我在我的 AWS Lambda 控制台中设置了这些环境变量:
"LD_LIBRARY_PATH": "/tmp/code/lib/",
"PROJ_LIB": "/tmp/code/lib/proj4/",
在我的(Django)应用程序的设置文件中,我设置:
GDAL_LIBRARY_PATH = "/tmp/code/lib/libgdal.so.20.1.3"
GEOS_LIBRARY_PATH = "/tmp/code/lib/libgeos_c.so.1"
现在我收到错误
OSError: /tmp/code/lib/libgdal.so.20.1.3: cannot open shared object file: No such file or directory
我怎样才能解决这个问题 ?
我所做的总结
$ pip install zappa
$ zappa init
$ zappa deploy prod
下面是我的 zappa_settings.json
{
"prod": {
"aws_region": "us-east-1",
"django_settings": "Cool.settings",
"profile_name": "default",
"project_name": "cool",
"runtime": "python3.6",
"s3_bucket": "coolplaces-t47c5adgt",
"extra_permissions": [{
"Effect": "Allow",
"Action": ["rekognition:*"],
"Resource": "*"
}]
}
}