Skip to content
Snippets Groups Projects
Commit 2a2be2f1 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Check that AWS vars is set befor using them in storage_backends.py.

parent 2366df81
No related branches found
No related tags found
No related merge requests found
...@@ -3,15 +3,19 @@ from storages.backends.s3boto3 import S3Boto3Storage ...@@ -3,15 +3,19 @@ from storages.backends.s3boto3 import S3Boto3Storage
class PublicMediaStorage(S3Boto3Storage): class PublicMediaStorage(S3Boto3Storage):
bucket_name = settings.AWS_PUBLIC_BUCKET_NAME if hasattr(settings, 'AWS_PUBLIC_BUCKET_NAME'):
bucket_name = settings.AWS_PUBLIC_BUCKET_NAME
file_overwrite = False file_overwrite = False
querystring_auth = False querystring_auth = False
url_protocol = 'https:' url_protocol = 'https:'
class PrivateMediaStorage(S3Boto3Storage): class PrivateMediaStorage(S3Boto3Storage):
if hasattr(settings, 'AWS_PRIVATE_BUCKET_NAME'):
bucket_name = settings.AWS_PRIVATE_BUCKET_NAME
bucket_acl = 'private' bucket_acl = 'private'
bucket_name = settings.AWS_PRIVATE_BUCKET_NAME
custom_domain = False custom_domain = False
default_acl = 'private' default_acl = 'private'
encryption = True encryption = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment