diff --git a/server/backend/custom_azure.py b/server/backend/custom_azure.py index 1621f1c0..910c309e 100644 --- a/server/backend/custom_azure.py +++ b/server/backend/custom_azure.py @@ -5,14 +5,16 @@ from environs import Env env = Env() env.read_env() class AzureMediaStorage(AzureStorage): - account_name = env("IT_AZURE_STORAGE_ACCOUNT") - account_key = env("IT_AZURE_STORAGE_KEY") - azure_container = 'media' - expiration_secs = None + 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): - account_name = env("IT_AZURE_STORAGE_ACCOUNT") - account_key = env("IT_AZURE_STORAGE_KEY") - azure_container = 'static' - expiration_secs = None + 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