[Solved]-Django hosting static files in AWS S3 causing CORS error when trying to access admin font files

8👍

Configuring the following in S3 Bucket Permissions > CORS fixed the issue.

[
    {
        "AllowedHeaders": [
            "Authorization"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    },
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "HEAD",
            "GET",
            "PUT",
            "POST",
            "DELETE"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "ETag",
            "x-amz-meta-custom-header"
        ]
    }
]
👤eldos

0👍

I remember i faced this issue before with Google Cloud Storage.

You have to make your bucket allow origin cross to your domain.

Leave a comment