mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-19 04:22:23 +03:00
Fix storage config for azure
This commit is contained in:
parent
434c3d2c3a
commit
4080d0255a
|
@ -168,11 +168,7 @@ STORAGES = {
|
|||
{%- endif %}
|
||||
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
||||
"default": {
|
||||
"BACKEND": "storages.backends.azure_storage.AzureStorage",
|
||||
"OPTIONS": {
|
||||
"location": "media",
|
||||
"overwrite_files": False,
|
||||
},
|
||||
"BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage",
|
||||
},
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
"staticfiles": {
|
||||
|
@ -180,10 +176,7 @@ STORAGES = {
|
|||
},
|
||||
{%- else %}
|
||||
"staticfiles": {
|
||||
"BACKEND": "storages.backends.azure_storage.AzureStorage",
|
||||
"OPTIONS": {
|
||||
"location": "static",
|
||||
},
|
||||
"BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage",
|
||||
},
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
from storages.backends.azure_storage import AzureStorage
|
||||
|
||||
|
||||
class StaticAzureStorage(AzureStorage):
|
||||
location = "static"
|
||||
|
||||
|
||||
class MediaAzureStorage(AzureStorage):
|
||||
location = "media"
|
||||
file_overwrite = False
|
Loading…
Reference in New Issue
Block a user