Commits

Gert Van Gool  committed a94fbaa

Added location support (you can now create the bucket in EU)

  • Participants
  • Parent commits 6283cd9

Comments (0)

Files changed (1)

File backends/s3boto.py

 DEFAULT_ACL     = 'AWS_DEFAULT_ACL'
 QUERYSTRING_AUTH = 'AWS_QUERYSTRING_AUTH'
 QUERYSTRING_EXPIRE = 'AWS_QUERYSTRING_EXPIRE'
+LOCATION           = 'AWS_LOCATION'
 
 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)
 QUERYSTRING_EXPIRE= getattr(settings, QUERYSTRING_EXPIRE, 3600)
+LOCATION          = getattr(settings, LOCATION, '')
 
 
 class S3BotoStorage(Storage):
         self.connection = S3Connection(access_key, secret_key)
         bucket_name = bucketprefix + bucket
         try:
-            self.bucket = self.connection.create_bucket(bucket_name)
+            self.bucket = self.connection.create_bucket(bucket_name, {}, LOCATION)
             self.bucket.set_acl(self.acl)
         except S3CreateError:
             # assuming we own it