【发布时间】:2015-12-14 11:51:16
【问题描述】:
我正在尝试为我的 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 存储图像(并且一切正常运行了 2 周)。在我用 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?
这里是有问题的代码 sn-p:
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")
【问题讨论】: