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
Post a Comment