From 570930ef135ce4d195b02167764ecbc74d27fb69 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sat, 18 May 2019 22:49:10 -0400 Subject: [PATCH 1/3] If using whitenoise disable AWS and GCE for static If using whitenoise disable AWS and GCE for static setting. --- {{cookiecutter.project_slug}}/config/settings/production.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 6b79b0af..0c94b2d8 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,11 +99,10 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- endif -%} -{%- if cookiecutter.cloud_provider == 'AWS' %} +{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From adcc5d0b2889a59aa7e79f8d17e521ed92bee32c Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:14 -0400 Subject: [PATCH 2/3] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 0c94b2d8..203612ca 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,7 +99,7 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} +{%- elif cookiecutter.cloud_provider == 'AWS' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} From 8c69a1203f22ca996c5f2b47ea65e3c51f874ce0 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:28 -0400 Subject: [PATCH 3/3] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 203612ca..1a5889d5 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -102,7 +102,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {%- elif cookiecutter.cloud_provider == 'AWS' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} +{%- elif cookiecutter.cloud_provider == 'GCE' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %}