diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 3d4f324c..ce381715 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -236,10 +236,12 @@ ANYMAIL = {} # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) # 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" -{%- elif cookiecutter.cloud_provider == 'GCP' %} +{%- elif cookiecutter.cloud_provider == 'GCP' and cookiecutter.use_whitenoise == 'y' %} 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' %} COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage" {%- endif %}