From 6afdef61b83b8bf0f4aac392122748f4185efeb3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 24 Mar 2015 17:04:01 -0400 Subject: [PATCH] Can't use AWS_STORAGE_BUCKET_NAME until post_setup. --- CONTRIBUTORS.txt | 1 + .../{{cookiecutter.repo_name}}/config/production.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 55f3251f2..6a4756699 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -38,6 +38,7 @@ Andy Rose Andrew Mikhnevich / @zcho Kevin Ndung'u / @kevgathuku Kaveh / @ka7eh +Jeff Johnson / @jeffcjohnson * Possesses commit rights diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py index fb0711f4f..ccb3d53ba 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py @@ -92,9 +92,6 @@ class Production(Common): 'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % ( AWS_EXPIRY, AWS_EXPIRY) } - - # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url - STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME # END STORAGE CONFIGURATION # EMAIL @@ -130,3 +127,8 @@ class Production(Common): # END CACHING # Your production stuff: Below this line define 3rd party library settings + + @classmethod + def post_setup(cls): + # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url + cls.STATIC_URL = 'https://s3.amazonaws.com/%s/' % cls.AWS_STORAGE_BUCKET_NAME