Commits

Anonymous committed b95049e

Added AWS_FORCE_HTTP_URLS setting that exposes the force_http toggle on URL generation.

Comments (0)

Files changed (1)

 DEFAULT_ACL     = 'AWS_DEFAULT_ACL'
 QUERYSTRING_AUTH = 'AWS_QUERYSTRING_AUTH'
 QUERYSTRING_EXPIRE = 'AWS_QUERYSTRING_EXPIRE'
+FORCE_HTTP_URLS = 'AWS_FORCE_HTTP_URLS'
 
 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)
+FORCE_HTTP_URLS = getattr(settings, FORCE_HTTP_URLS, False)
 
 
 class S3BotoStorage(Storage):
     
     def url(self, name):
         name = self._clean_name(name)
-        return self.bucket.get_key(name).generate_url(QUERYSTRING_EXPIRE, method='GET', query_auth=QUERYSTRING_AUTH)
+        return self.bucket.get_key(name).generate_url(QUERYSTRING_EXPIRE, method='GET', query_auth=QUERYSTRING_AUTH, force_http=FORCE_HTTP_URLS)
     
     def get_available_name(self, name):
         """ Overwrite existing file with the same name. """