django-cors-middleware
django-cors-middleware copied to clipboard
CORS accept Post Requests from other domain
trafficstars
I have a API with django-rest-framework and django-cors-headers configured in stage env
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = (
'myotherdmain.com',
)
CSRF_TRUSTED_ORIGINS = (
'myotherdomain.com',
)
When I do GET requests from my localhost to the published API is blocked and ok. But if I try POST requests I don't recieve any error message and the request is allowed. What am I doing wrong ? What I get is: with CORS, API will not allowed to recieve any request from other domain wich isn't in CORS_ORIGIN_WHITELIST.
Ideas? Django version: 1.10.5
Thanks !
I am facing the same problem.