-
Notifications
You must be signed in to change notification settings - Fork 0
Store files in cloud object storage #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
318b683
to
66c7867
Compare
c817cb7
to
bf71263
Compare
session = boto3.session.Session() | ||
return session.client( | ||
"s3", | ||
endpoint_url=f"https://{BUCKET_REGION}.digitaloceanspaces.com/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole Endpoint URL could be a env var? Allows changing provider easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, but then maybe the addressing_style config below should be a config? Maybe then it gets confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also ran into an issue later down the line where the boto3
client doesn't return the public URL of the uploaded file, so we have to construct that ourselves, which can be different depending on the provider, and it's easier to have all the parts, rather than a single URL. This ended up being the nicest way I could find
bf71263
to
59b8da6
Compare
Depends on #20
Closes #8