python - Django cors error even after installing cors-headers -


my python view using requests, so:

r = requests.post(url, params=data, headers=header) print r.url return httpresponse(r) 

the object posted redirect url. when url called, activity stops in browser , error thrown:

cross-origin request blocked: same origin policy disallows reading remote resource @ https://<website>.com. can fixed moving resource same domain or enabling cors. 

i have installed django-cors-headers following line added in settings.py:

cors_origin_allow_all = true 

why still getting error?

make sure have added correct cors middleware , more importantly sequence , allowed methods too. also, make sure it's listed in installed_apps setting.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -