【发布时间】:2016-05-01 21:02:54
【问题描述】:
尝试在 Django 中为 Google Cloud Storage 配置存储处理程序。
我已经安装了 django-storages,并将storages 添加到我的INSTALLED_APPS。
我已经安装了 apache-libcloud。
我从https://curl.haxx.se/docs/caextract.html 下载了this file,并将其路径附加到CA_CERTS_PATH。我将 Mac OSX 与 Django 1.9 和最新版本的 Google SDK 一起使用。这是在我的本地环境中。
# settings.py
libcloud.security.CA_CERTS_PATH.append(os.path.join(BASE_DIR, 'cacerts.pem'))
LIBCLOUD_PROVIDERS = {
'google': {
'type' : 'libcloud.storage.types.Provider.GOOGLE_STORAGE',
'user' : <my user, hidden here>,
'key' : <my key, hidden as well>,
'bucket': <bucket name>,
}
}
DEFAULT_LIBCLOUD_PROVIDER = 'google'
DEFAULT_FILE_STORAGE = 'storages.backends.apache_libcloud.LibCloudStorage'
STATICFILES_STORAGE = 'storages.backends.apache_libcloud.LibCloudStorage'
Per these docs,我已经确认CA_CERTS_PATH肯定包含 cacerts.pem 文件。
然而,当我运行dev_appserver.py 时,我遇到了这个问题:
Unable to create libcloud driver type libcloud.storage.types.Provider.GOOGLE_STORAGE: No CA Certificates were found in CA_CERTS_PATH. For information on how to get required certificate files, please visit https://libcloud.readthedocs.org/en/latest/other/ssl-certificate-validation.html
我错过了什么?我的配置有什么问题 libcloud 不起作用?这是我第一次使用 Django 或 Google Cloud Storage 设置任何自定义存储配置。欢迎所有输入。
【问题讨论】:
标签: certificate google-cloud-storage django-storage