Add Azure Storage as an option to serve static and media files

This commit is contained in:
Jeh 2023-01-17 11:52:14 +05:30 committed by GitHub
parent 50f4c4ec56
commit 9b2a3636ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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