diff --git a/env_secrets/production_azure.env b/env_secrets/production_azure.env index e0c09b6b..b5149493 100644 Binary files a/env_secrets/production_azure.env and b/env_secrets/production_azure.env differ diff --git a/server/backend/__init__.py b/server/backend/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/server/backend/custom_azure.py b/server/backend/custom_azure.py deleted file mode 100644 index d84ec148..00000000 --- a/server/backend/custom_azure.py +++ /dev/null @@ -1,21 +0,0 @@ -from environs import Env -from storages.backends.azure_storage import AzureStorage - -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 diff --git a/server/config/settings/base.py b/server/config/settings/base.py index d655b3c8..06b57573 100644 --- a/server/config/settings/base.py +++ b/server/config/settings/base.py @@ -214,20 +214,6 @@ if USE_AWS: # https://wagtail.org/blog/amazon-s3-for-media-files/ MEDIA_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" -elif env("IT_USE_AZURE_BLOB_STORAGE", False): - # https://medium.com/@DawlysD/django-using-azure-blob-storage-to-handle-static-media-assets-from-scratch-90cbbc7d56be - DEFAULT_FILE_STORAGE = "backend.custom_azure.AzureMediaStorage" - # STATICFILES_STORAGE = 'backend.custom_azure.AzureStaticStorage' - - # STATIC_LOCATION = "static" - MEDIA_LOCATION = "media" - - AZURE_ACCOUNT_NAME = env("IT_AZURE_STORAGE_ACCOUNT") - AZURE_CUSTOM_DOMAIN = f"{AZURE_ACCOUNT_NAME}.blob.core.windows.net" - # STATIC_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{APP_ENVIRONMENT}/{STATIC_LOCATION}/' - MEDIA_URL = f"https://{AZURE_CUSTOM_DOMAIN}/{APP_ENVIRONMENT}/{MEDIA_LOCATION}/" - - else: MEDIA_URL = "/server/media/"