[Django]-AWS S3 Bucket Django 3.0 User Profile Image Upload Access ERROR

3👍

In the AWS console, click the “Permissions” tab, then on the

  1. allow public access to your bucket -> Save -> Confirm it
  2. “Bucket policy” button. An editing box will appear. Replace the “arn:aws:s3:::” in the editing box with the part starting with “arn:” shown above your editing box, but be careful to preserve the “/*” at the end of it. Use the following code bellow. Paste in the following:
 {
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"PublicReadGetObject",
        "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::your-buckt-arn/*"
      ]
    }
  ]
}
👤rossi

1👍

Not sure if you are still trying the issue.

You can try adding a parameter:
AWS_DEFAULT_ACL = ‘public-read’ in your setting.py

Delete all the previously uploaded files in your bucket.

Re-upload media and static files.

See if it works.

Leave a comment