Rich Leland avatar Rich Leland committed 28edf05

Cleaned up AWS_ settings within file.

Comments (0)

Files changed (1)


     raise ImproperlyConfigured, "Could not load Boto's S3 bindings.\
-BUCKET_PREFIX     = getattr(settings, BUCKET_NAME, {})
-HEADERS           = getattr(settings, HEADERS, {})
-DEFAULT_ACL       = getattr(settings, DEFAULT_ACL, 'public-read')
-QUERYSTRING_AUTH  = getattr(settings, QUERYSTRING_AUTH, True)
+ACCESS_KEY_NAME     = getattr(settings, 'AWS_ACCESS_KEY_ID', None)
+SECRET_KEY_NAME     = getattr(settings, 'AWS_SECRET_ACCESS_KEY', None)
+HEADERS             = getattr(settings, 'AWS_HEADERS', {})
+DEFAULT_ACL         = getattr(settings, 'AWS_DEFAULT_ACL', 'public-read')
+QUERYSTRING_AUTH    = getattr(settings, 'AWS_QUERYSTRING_AUTH', True)
 class S3BotoStorage(Storage):
     """Amazon Simple Storage Service using Boto"""
-    def __init__(self, bucket=BUCKET_PREFIX, access_key=None, secret_key=None,
-                       acl=DEFAULT_ACL, headers=HEADERS):
+    def __init__(self, bucket=STORAGE_BUCKET_NAME, access_key=None,
+                       secret_key=None, acl=DEFAULT_ACL, headers=HEADERS):
         self.acl = acl
         self.headers = headers
     def _get_access_keys(self):
-        access_key = getattr(settings, ACCESS_KEY_NAME, None)
-        secret_key = getattr(settings, SECRET_KEY_NAME, None)
+        access_key = ACCESS_KEY_NAME
+        secret_key = SECRET_KEY_NAME
         if (access_key or secret_key) and (not access_key or not secret_key):
             access_key = os.environ.get(ACCESS_KEY_NAME)
             secret_key = os.environ.get(SECRET_KEY_NAME)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.