CORS django 'Access-Control-Allow-Origin' CORS django 'Access-Control-Allow-Origin' ajax ajax

CORS django 'Access-Control-Allow-Origin'


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/


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


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