Configuring access conrol allow origin

Posted January 27, 2020 6.4k views
Object Storage

Access to font at ’’ from origin ’http://localhost:8000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

These are one of the files from collectstatic.

This is the error I get on my spaces account.

I am using Django with Boto3 and django-storages.

How can I get these files to work.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @acsfess,

Django by default does not provide the headers necessary to provide cross origin. The easiest way would be to just use this Django app that handles it for you:

You can then set whichever domains you want white listed using the settings


to support allowing all, just use the setting… CORS_ORIGIN_ALLOW_ALL = True and then do any filtering of the request in the middleware or in the view.