From a660ffcc313623d69e437afb6f27734c372f717a Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Mon, 25 Nov 2019 14:26:37 +0300 Subject: [PATCH] static to Amazon #2 --- project/settings/amazon_s3.py | 2 +- project/settings/production.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/project/settings/amazon_s3.py b/project/settings/amazon_s3.py index c96da5d9..b602618d 100644 --- a/project/settings/amazon_s3.py +++ b/project/settings/amazon_s3.py @@ -13,7 +13,7 @@ AWS_S3_OBJECT_PARAMETERS = {'CacheControl': 'max-age=86400'} AWS_S3_ADDRESSING_STYLE = 'path' # Static settings -PUBLIC_STATIC_LOCATION = 'static' +PUBLIC_STATIC_LOCATION = 'static-dev' STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/{PUBLIC_STATIC_LOCATION}/' STATICFILES_STORAGE = 'project.storage_backends.PublicStaticStorage' diff --git a/project/settings/production.py b/project/settings/production.py index 997d6526..7ef2dc62 100644 --- a/project/settings/production.py +++ b/project/settings/production.py @@ -4,6 +4,11 @@ from .amazon_s3 import * import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration + +PUBLIC_STATIC_LOCATION = 'static' +STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/{PUBLIC_STATIC_LOCATION}/' +STATICFILES_STORAGE = 'project.storage_backends.PublicStaticStorage' + # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False