mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-03 13:14:28 +03:00
Merge pull request #201 from pydanny/fix-s3-calling-format
fix(settings): fix non-existing import of s3
This commit is contained in:
commit
4404122bda
|
@ -9,14 +9,6 @@ Production Configurations
|
||||||
'''
|
'''
|
||||||
from configurations import values
|
from configurations import values
|
||||||
|
|
||||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
|
||||||
try:
|
|
||||||
from S3 import CallingFormat
|
|
||||||
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
|
|
||||||
except ImportError:
|
|
||||||
# TODO: Fix this where even if in Dev this class is called.
|
|
||||||
pass
|
|
||||||
|
|
||||||
from .common import Common
|
from .common import Common
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,6 +84,12 @@ class Production(Common):
|
||||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (
|
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (
|
||||||
AWS_EXPIRY, AWS_EXPIRY)
|
AWS_EXPIRY, AWS_EXPIRY)
|
||||||
}
|
}
|
||||||
|
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html
|
||||||
|
try:
|
||||||
|
from boto.s3.connection import OrdinaryCallingFormat
|
||||||
|
AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user