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

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

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -