mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-27 17:00:44 +03:00
evaluate the AWS values first
This commit is contained in:
parent
deb0221c3d
commit
063a6332a3
|
@ -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__))
|
||||
|
|
Loading…
Reference in New Issue
Block a user