我正在尝试为我的 Django 应用程序(托管在具有 Ubuntu 操作系统的 Azure VM 上的应用程序)设置 Azure 云存储。我已将 Django-storages 安装为软件包,并且按照以下步骤操作:http://django-storages.readthedocs.org/en/latest/backends/azure.html ,将以下行添加到我的 settings.py 文件中:
DEFAULT_FILE_STORAGE = 'storages.backends.azure_storage.AzureStorage'
AZURE_ACCOUNT_NAME = 'photodatabasestorage'
AZURE_ACCOUNT_KEY = 'something'
AZURE_CONTAINER = 'somecontainer'
在此之前,我使用类似的设置通过 Amazon S3 存储图像(两周内一切正常)。当我用 Azure 代码替换 S3 代码时,我开始收到以下错误:
异常值:
**Could not load Azure bindings.** See
https://github.com/WindowsAzure/azure-sdk-for-python
Exception Location:
/home/mhb11/.virtualenvs/myvirtualenv/local/lib/python2.7/site-packages/storages/backends/azure_storage.py
in <module>, line 12?
这是有问题的代码片段:
from django.core.exceptions import ImproperlyConfigured
try:
import azure
import azure.storage
except ImportError:
raise ImproperlyConfigured(
"Could not load Azure bindings. "
"See https://github.com/WindowsAzure/azure-sdk-for-python")
最佳答案
关于python - Django 应用程序中的 Azure 云存储配置错误 : Could not load Azure bindings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34266346/