From 9b2a3636ab80bc9fd111d4680b0b6b1d03de7bac Mon Sep 17 00:00:00 2001 From: Jeh Date: Tue, 17 Jan 2023 11:52:14 +0530 Subject: [PATCH] Add Azure Storage as an option to serve static and media files --- .../{{cookiecutter.project_slug}}/utils/storages.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py index b712d3239..27595ad1a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py @@ -22,4 +22,15 @@ class StaticRootGoogleCloudStorage(GoogleCloudStorage): class MediaRootGoogleCloudStorage(GoogleCloudStorage): location = "media" file_overwrite = False +{%- elif cookiecutter.cloud_provider == 'Azure' -%} +from storages.backends.azure_storage import AzureStorage + + +class StaticRootAzureStorage(AzureStorage): + location = "static" + + +class MediaRootAzureStorage(AzureStorage): + location = "media" + file_overwrite = False {%- endif %}