-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Migrate to the unified STORAGES
setting added in Django 4.2
#4477
Migrate to the unified STORAGES
setting added in Django 4.2
#4477
Conversation
…hipndell/cookiecutter-django
# Conflicts: # {{cookiecutter.project_slug}}/config/settings/production.py
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 code looks fine to me.
I made one comment to specify the object storage options directly in the settings file as recommended in the django-storages docs.
Is there something missing or could we get this merged?
}, | ||
{%- elif cookiecutter.cloud_provider == 'AWS' %} | ||
"default": { | ||
"BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaS3Storage", |
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.
To avoid relying on the instantiated storage classes, should we provide the settings here directly like so:
"default": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"location": "static",
"default_acl": "public-read",
},
},
"staticfiles": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"location": "media",
"file_overwrite": False,
},
},
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.
Yes great suggestion
Last time I tried to deploy this change I hit some permission issues with AWS S3, but I couldn't figure out if it was caused by this PR or soemthing that changed in AWS. If you could try out a combination or 2 you care about, and feedback your results, that would be very helpful. You can run it against my branch with: |
@browniebroke was this perhaps the error that you have seen? There can also be an issue if the bucket is in the new eu-central-2 Zurich region, since it is opt-in But other than that, if ACLs are enabled for the bucket, there are no permission issues in AWS during my test |
I am happy to help change the settings file and delete |
It's now merged so feel free to create a new PR to do these changes 👍🏻 Thanks for your help in getting this reviewed. |
Thanks @browniebroke! |
Thanks to you @browniebroke ! |
Description
There was a PR open for it in #4457 but the author closed it before it could be merged. Re-opening it with commits attributions.
Checklist:
Rationale
Fix #4443