Remove references to `IT_USE_AZURE_BLOB_STORAGE`

This commit is contained in:
Daniel Egger 2023-05-30 11:41:42 +02:00
parent 956a685ac9
commit 8eb87327df
4 changed files with 0 additions and 35 deletions

Binary file not shown.

View File

@ -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

View File

@ -214,20 +214,6 @@ if USE_AWS:
# https://wagtail.org/blog/amazon-s3-for-media-files/ # https://wagtail.org/blog/amazon-s3-for-media-files/
MEDIA_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN MEDIA_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" 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: else:
MEDIA_URL = "/server/media/" MEDIA_URL = "/server/media/"