Skip to content
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

Сustom bucket endpoint url #38

Merged
merged 4 commits into from
Oct 30, 2021
Merged

Conversation

kidig
Copy link

@kidig kidig commented Oct 27, 2021

Hi there!

There a few S3-like services, who also use standard boto3 package.
For example, the Object Storage at Yandex.Cloud (https://cloud.yandex.com/en-ru/services/storage).

I've just add an optional setting S3UPLOAD_BUCKET_ENDPOINT. It's enough for third-party storages!

"That's one small change for the library. One giant leap for the django!" 😉

Copy link
Collaborator

@hugorodgerbrown hugorodgerbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kidig thanks for the PR - the change seems like a good one in principal. I have highlighted one are where I think there is a gap. Could you add some tests for this case (test get_file_url function with a setting that includes both region and bucket placeholders), and ensure that it won't fail.

s3upload/widgets.py Outdated Show resolved Hide resolved
@kidig
Copy link
Author

kidig commented Oct 29, 2021

@hugorodgerbrown I moved it to a function and added some tests.
Also deal with the bucket_name to make the utils more consistent.

@hugorodgerbrown hugorodgerbrown merged commit bd78fc3 into yunojuno:master Oct 30, 2021
@hugorodgerbrown
Copy link
Collaborator

Thanks @kidig - I've run the tests, and they look good, and have merged your PR. I'll publish an update in due course (you can pin to master in the meantime).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants