-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make django-mini-backend Region aware #39
Conversation
thank you very much for the PR, @subho007 - looks like a very high quality set of changes. i'll review it ASAP |
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.
i propose to update the return statement to avoid duplicating slashes.
besides that I'm trying to figure out what's wrong with the old method. the Minio client is instantiated from the very same settings.py
parameters, therefore, i don't see it as hardcoding. could you point that out for me, please?
The default Region is set to us-east-1 the public URL generated for AWS specific resources is diferent than minio specific servers. Still, minio SDK has a special reference to figure out how to generate URLs if AWS is used in the backend.
@theriverman I apologise for not being clear about the issue. The old implementation takes the hardcoded value written in Which means, if my S3 bucket is hosted in The reference to this is here: https://github.com/minio/minio-py/blob/master/minio/helpers.py#L426-L458 The region specific parameters are added here: https://github.com/minio/minio-py/blob/master/minio/helpers.py#L535-L572 And for S3 accelerated URL parameters are added here: https://github.com/minio/minio-py/blob/master/minio/helpers.py#L555-L578 Common hosted minio solution may not have any affect, but projects which uses minio instead of Hence, I am using the Note: You may say why don't I put in |
@subho007 thank you very much for the changes and for the brief explanation of your request. i've missed that initial detail you aim to support communication towards AWS S3 too. When I was implementing this package I was focusing solely on MinIO, but I don't have anything against this rather minor change. |
@subho007 v3.4.0 pushed to PyPI. thanks a lot for your contribution! |
Similar PR was raised at #38 but unfortunately it was not a complete implementation.
The following were changed and added:
MINIO_REGION
value from settings or set it tous-east-1
which is the default value (Minio itself uses that as a default value)README.md
is updatedThis Fixes few problems:
I have already tested it out with local/hosted instance of minio and with AWS S3 service. Forked version of this is published in my PyPI: https://pypi.org/project/ak-django-minio-backend/ (I'll delete as soon as this gets merged, tested, approved released)