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

Please upgrade to boto3? #205

Open
jamescosmin opened this issue Jun 29, 2020 · 5 comments
Open

Please upgrade to boto3? #205

jamescosmin opened this issue Jun 29, 2020 · 5 comments

Comments

@jamescosmin
Copy link

Hey Richard,

Kindly upgrade to boto3? Thank you.
https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

Migration from the boto-based to boto3-based backend should be straightforward and painless.
The following adjustments to settings are required:
• Rename AWS_HEADERS to AWS_S3_OBJECT_PARAMETERS and change the format of the key names as in
the following example: cache-control becomes CacheControl.
• Raname AWS_ORIGIN to AWS_S3_REGION_NAME
• If AWS_S3_CALLING_FORMAT is set to VHostCallingFormat set AWS_S3_ADDRESSING_STYLE to
virtual
• Replace the combination of AWS_S3_HOST and AWS_S3_PORT with AWS_S3_ENDPOINT_URL
• Extract the region name from AWS_S3_HOST and set AWS_S3_REGION_NAME
• Replace AWS_S3_PROXY_HOST and AWS_S3_PROXY_PORT with AWS_S3_PROXIES
• If using signature version s3v4 you can remove S3_USE_SIGV4
• If you persist urls and rely on the output to use the signature version of s3 set
AWS_S3_SIGNATURE_VERSION to s3
• Update DEFAULT_FILE_STORAGE and/or STATICFILES_STORAGE to storages.backends.
s3boto3.S3Boto3Storage
Additionally, you must install boto3. In order to use all currently supported features, 1.4.4 is the minimum required
version although we always recommend the most recent.

@richardbarran
Copy link
Owner

Hi,
It sounds like a good idea - I personally do not use S3, but if someone wants to prepare a PR and send it in, I will be happy to review it.

@hvitis
Copy link
Contributor

hvitis commented Jul 13, 2020

Do I understand correctly that the "upgrade" is only changing the variables names and formating a bit?

Or there is some deeper boto3 logic / dependency hidden in photologue?

@jamescosmin
Copy link
Author

Hey hvitis,

Sorry for the delay. It sure seems like it but it is not as easy as it sounds. Here's more on what type of error you will encounter:
https://stackoverflow.com/questions/49177889/setting-default-file-storage-in-settings-py-breaks-app

I wish there was a simple way to make it work but I think I'll have to go with a different package in the end.

richardbarran pushed a commit that referenced this issue Aug 31, 2020
Solving #205 Encoding objects before hashing error
@dearandrewkim
Copy link

Hi all,
Adding +1 to this. Would love to see botos3 implemented in the future.. I was planning to use it for my project but when I deployed it to staging, there were errors and was unable to grab the image..

@derek-adair
Copy link

Personally, I'd recommend leaving backend integration out of this project altogether as it seems like a mix of concerns. I've not tested it yet but my plan is to just use django-storages with this application.

It is also not as simple as updating a config... although there are really not that many changes to make. Anyone interested can read up here.

Or just use django-storages which has... everything you'd ever want.

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

No branches or pull requests

5 participants