From 063a6332a3ec6920c2e51de3c845e5be076b1871 Mon Sep 17 00:00:00 2001 From: Nate Aune Date: Thu, 26 Sep 2013 15:36:05 -0400 Subject: [PATCH] evaluate the AWS values first --- .../config/settings.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py index b77d776c..b3c6fcf1 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py @@ -327,15 +327,6 @@ class Production(Common): INSTALLED_APPS += ("gunicorn", ) try: # serve static assets using S3 - ########## STORAGE CONFIGURATION - # See: http://django-storages.readthedocs.org/en/latest/index.html - INSTALLED_APPS += ( - 'storages', - ) - - # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings - STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' - # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings AWS_ACCESS_KEY_ID = values.SecretValue() AWS_SECRET_ACCESS_KEY = values.SecretValue() @@ -350,8 +341,21 @@ class Production(Common): AWS_EXPIREY) } + ########## STORAGE CONFIGURATION + # See: http://django-storages.readthedocs.org/en/latest/index.html + INSTALLED_APPS += ( + 'storages', + ) + + # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings + STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' + # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME + + # TODO: check that this actually works + MEDIA_URL = 'https://s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME + ########## END STORAGE CONFIGURATION except: # serve static assets using wsgi PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))