evaluate the AWS values first

This commit is contained in:
Nate Aune 2013-09-26 15:36:05 -04:00
parent deb0221c3d
commit 063a6332a3

View File

@ -327,15 +327,6 @@ class Production(Common):
INSTALLED_APPS += ("gunicorn", ) INSTALLED_APPS += ("gunicorn", )
try: # serve static assets using S3 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 # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
AWS_ACCESS_KEY_ID = values.SecretValue() AWS_ACCESS_KEY_ID = values.SecretValue()
AWS_SECRET_ACCESS_KEY = values.SecretValue() AWS_SECRET_ACCESS_KEY = values.SecretValue()
@ -350,8 +341,21 @@ class Production(Common):
AWS_EXPIREY) 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 # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME 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 ########## END STORAGE CONFIGURATION
except: # serve static assets using wsgi except: # serve static assets using wsgi
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))