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

Breaking change in Django-Storages #7

Closed
stuartmaxwell opened this issue Sep 11, 2020 · 3 comments
Closed

Breaking change in Django-Storages #7

stuartmaxwell opened this issue Sep 11, 2020 · 3 comments

Comments

@stuartmaxwell
Copy link

Hi there - thanks for writing up this repo and the accompanying article. Just wanted to let you know that there have been a number of breaking changes with the latest update of Django-Storages. The result is that files uploaded with the collectstatic files will not be set to public-read permissions, which obviously means that all the static files are not accessible to the public.

The fix is easy and you need to replace:

AWS_DEFAULT_ACL = 'public-read'

with

AWS_S3_OBJECT_PARAMETERS = {
    'ACL': 'public-read',
}

Also, because your code is also changing the CacheControl parameter, the full fix is as follows:

AWS_S3_OBJECT_PARAMETERS = {
    "ACL": "public-read",
    "CacheControl": "max-age=86400"
}

Hope that helps - this issue has more details and better explanation: jschneier/django-storages#927

Cheers - Stuart.

@mjhea0
Copy link
Contributor

mjhea0 commented Sep 11, 2020

Thanks for sharing this @stuartmaxwell. I'll make the changes next time I update the post.

@readybeginn
Copy link

This was fixed in release 1.10.1 per this comment.

@mjhea0
Copy link
Contributor

mjhea0 commented Apr 27, 2021

Updating the post now. Using version 1.11.1, and it still works fine with AWS_DEFAULT_ACL / default_acl.

@mjhea0 mjhea0 closed this as completed Apr 27, 2021
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

3 participants