[Fixed]-CORS django 'Access-Control-Allow-Origin'

13πŸ‘

βœ…

It says No 'Access-Control-Allow-Origin' header is present on the requested resource. which means your server application needs tunning to accept cross origin requests.
Cross origin requests are by default not working due to security reasons. You need to enable them.

For django there is a maintained package with good amount of settings just for this: https://github.com/ottoyiu/django-cors-headers/

πŸ‘€T. Opletal

3πŸ‘

After 2 hours of troubleshooting I found solution: TYPO in url.
Check twice, maybe it will fix your issue too.

πŸ‘€Seyhak Ly

-1πŸ‘

For this thing to work you need to do two thing:


  • instead of https:// just give http:// in your CORS_ORIGIN_WHITELIST in settings.py

  • add CORS_ORIGIN_ALLOW = True in the same file

πŸ‘€Pronay Guha

Leave a comment