mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 11:34:00 +03:00
Add STATICFILES_STORAGE with compressor support
This commit is contained in:
parent
6f7d4b79c3
commit
55d3d95333
|
@ -236,10 +236,12 @@ ANYMAIL = {}
|
||||||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED
|
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED
|
||||||
COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True)
|
COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True)
|
||||||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE
|
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE
|
||||||
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
{%- if cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'y' %}
|
||||||
COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
|
COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
|
||||||
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
{%- elif cookiecutter.cloud_provider == 'GCP' and cookiecutter.use_whitenoise == 'y' %}
|
||||||
COMPRESS_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
|
COMPRESS_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
|
||||||
|
{%- elif cookiecutter.cloud_provider == 'AWS' or cookiecutter.cloud_provider == 'GCP' %}
|
||||||
|
COMPRESS_STORAGE = STATICFILES_STORAGE
|
||||||
{%- elif cookiecutter.cloud_provider == 'None' %}
|
{%- elif cookiecutter.cloud_provider == 'None' %}
|
||||||
COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage"
|
COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user