3👍
I can see STATIC_URL
and MEDIA_URL
not setup correctly.
change
STATIC_URL = 'https://%s.static/' % AWS_S3_DOMAIN
MEDIA_URL = 'https://%s.media/' % AWS_S3_DOMAIN
To
STATIC_URL = 'https://%s/static/' % AWS_S3_DOMAIN
MEDIA_URL = 'https://%s/media/' % AWS_S3_DOMAIN
It should work.
The following link has a very good explanation.
https://simpleisbetterthancomplex.com/tutorial/2017/08/01/how-to-setup-amazon-s3-in-a-django-project.html
0👍
I had the same issue but with me it was a ACL issue. I could only get collectstatic to run if I set AWS_DEFAULT_ACL=None but then all the files would be set to private by default and couldn’t access them from the app.
To fix I had to change the S3 bucket Object Ownership to Bucket owner preferred so that it accepted the public-read ACL.
- [Django]-How to translate whole html page in another language in Django?
- [Django]-Allow access to only non-logged in user in django
- [Django]-Django aws S3 define upload file path and file dynamically
- [Django]-What is the reason for the nested template directory structure in Django?
- [Django]-Django 1.6: Clear data in one table
Source:stackexchange.com