Problem: I am developing a website using django, with images and static content stored in S3. I get 403 forbidden errors when I run my site on local host.
GET https://mybucket.s3.amazonaws.com/static/image.jpg 403 (Forbidden)
What I have tried so far:
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
python manage.py collectstatic
to upload static files to S3, so I know this connection is established.Does anyone know what I am missing?
This was resolved by fixing the structure of my django project. It was not obvious, but BASE_DIR was pointing to the incorrect directory.