vbv/server/backend/custom_azure.py

21 lines
629 B
Python

from storages.backends.azure_storage import AzureStorage
from environs import Env
env = Env()
env.read_env()
class AzureMediaStorage(AzureStorage):
if env("IT_USE_AZURE_BLOB_STORAGE", False):
account_name = env("IT_AZURE_STORAGE_ACCOUNT")
account_key = env("IT_AZURE_STORAGE_KEY")
azure_container = 'media'
expiration_secs = None
class AzureStaticStorage(AzureStorage):
if env("IT_USE_AZURE_BLOB_STORAGE", False):
account_name = env("IT_AZURE_STORAGE_ACCOUNT")
account_key = env("IT_AZURE_STORAGE_KEY")
azure_container = 'static'
expiration_secs = None