Commits

David Larlet  committed 684e976

Exposes the query_auth argument to boto's generate_url via new a setting AWS_QUERYSTRING_AUTH (default True for backwards compatibility). Thanks James from @incuna for the patch.

  • Participants
  • Parent commits 0a76f62

Comments (0)

Files changed (1)

File backends/s3boto.py

 HEADERS         = 'AWS_HEADERS'
 BUCKET_NAME     = 'AWS_STORAGE_BUCKET_NAME'
 DEFAULT_ACL     = 'AWS_DEFAULT_ACL'
+QUERYSTRING_AUTH = 'AWS_QUERYSTRING_AUTH'
 QUERYSTRING_EXPIRE = 'AWS_QUERYSTRING_EXPIRE'
 
 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)
 
 
         return self.bucket.get_key(name).size
     
     def url(self, name):
-        return self.bucket.get_key(name).generate_url(QUERYSTRING_EXPIRE, method='GET')
+        return self.bucket.get_key(name).generate_url(QUERYSTRING_EXPIRE, method='GET', query_auth=QUERYSTRING_AUTH)
     
     def get_available_name(self, name):
         """ Overwrite existing file with the same name. """