mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-19 20:42:19 +03:00
Fix storage config for azure
This commit is contained in:
parent
434c3d2c3a
commit
4080d0255a
|
@ -168,11 +168,7 @@ STORAGES = {
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "storages.backends.azure_storage.AzureStorage",
|
"BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage",
|
||||||
"OPTIONS": {
|
|
||||||
"location": "media",
|
|
||||||
"overwrite_files": False,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||||
"staticfiles": {
|
"staticfiles": {
|
||||||
|
@ -180,10 +176,7 @@ STORAGES = {
|
||||||
},
|
},
|
||||||
{%- else %}
|
{%- else %}
|
||||||
"staticfiles": {
|
"staticfiles": {
|
||||||
"BACKEND": "storages.backends.azure_storage.AzureStorage",
|
"BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage",
|
||||||
"OPTIONS": {
|
|
||||||
"location": "static",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- 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