I am trying to run my Django App locally loading static files from my Sapces, most of css static files load, but some file slike icons don’t, it gets this error: net::ERR_ABORTED 403
I applied CORS plicies in my Spaces (GET and headers = ‘*’) and also applied CORS in my Django project
CORS_ALLOW_ALL_ORIGINS = True
INSTALLED_APPS = [
'corsheaders',
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
I really don’t know what else is failing, so I appreciate some help
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
I could suggest checking a couple of things here:
Make sure the font and icon files in your Spaces have the correct permissions. They should be set to
public
to allow public access.As you are seeing this mainly for font assets, ensure that the
Access-Control-Allow-Origin
header is present when these font resources are fetched. Sometimes, the issue might not be CORS but rather theContent-Type
being sent by Spaces. Ensure that the font or icon files are being served with the correct MIME types. For instance:.woff
files should be served withfont/woff
.woff2
files withfont/woff2
.ttf
files withfont/ttf
Let me know how it goes!
Best,
Bobby