Commits

Jannis Leidel committed 7b75212 Merge

Merged in fmartingr/django-storages/custom_host (pull request #66)

s3boto backend: Allows custom S3 host, port and choose if connection is secure

  • Participants
  • Parent commits c751701, 24ae8cb

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

         'application/x-javascript',
     ))
     url_protocol = setting('AWS_S3_URL_PROTOCOL', 'http:')
+    host = setting('AWS_S3_HOST', S3Connection.DefaultHost)
+    use_ssl = setting('AWS_S3_USE_SSL', True)
+    port = setting('AWS_S3_PORT', None)
 
     def __init__(self, acl=None, bucket=None, **settings):
         # check if some of the settings we've provided as class attributes
     def connection(self):
         if self._connection is None:
             self._connection = self.connection_class(
-                self.access_key, self.secret_key,
-                calling_format=self.calling_format)
+                self.access_key,
+                self.secret_key,
+                is_secure=self.use_ssl,
+                calling_format=self.calling_format,
+                host=self.host,
+                port=self.port,
+            )
         return self._connection
 
     @property