Skip to content

Instantly share code, notes, and snippets.

@marteinn
Last active December 27, 2019 17:35
Show Gist options
  • Save marteinn/e4ab42297b1d9a78c164 to your computer and use it in GitHub Desktop.
Save marteinn/e4ab42297b1d9a78c164 to your computer and use it in GitHub Desktop.
How to use https with S3 + django-storages + boto, with a bucket that contains a dot. (Add this in your settings.py)
AWS_ACCESS_KEY_ID = "YOUR_KEY_ID"
AWS_SECRET_ACCESS_KEY = "YOUR_ACCESS_KEY"
AWS_STORAGE_BUCKET_NAME = "BUCKET-NAME"
AWS_QUERYSTRING_AUTH = False
AWS_S3_SECURE_URLS = True
from boto.s3.connection import OrdinaryCallingFormat, S3Connection
AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
S3Connection.DefaultHost = "s3-eu-west-1.amazonaws.com" # Must match your specific region
@abirafdirp
Copy link

Where did you get the S3Connection docs? I've searched for tens of minutes..... Thanks!

@marteinn
Copy link
Author

@abirafdirp The S3Connection comes from the package boto. Will clarify in the gist description!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment