I'm working with two dev servers on my local machine (node & django's).
I've added django-cors-headers
to the project to allow all origins & methods (on dev) with the following settings :
CORS_ORIGIN_ALLOW_ALL = 'ALL'
CORS_ALLOW_METHODS = (
'GET',
'POST',
'PUT',
'PATCH',
'DELETE',
'OPTIONS'
)
I'm getting 405 when attempting DELETE. Looking at the response headers
HTTP/1.0 405 METHOD NOT ALLOWED
Date: Mon, 03 Nov 2014 10:04:43 GMT
Server: WSGIServer/0.1 Python/2.7.5
Vary: Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Access-Control-Allow-Origin: *
Allow: GET, POST, HEAD, OPTIONS
Notice that DELETE
& PATCH
/ PUT
are not present in the allowed methods list.
Is there something missing from my configuration ?
viewsets.ModelViewSet
- tests run perfectly. – DohertyCORS_ALLOW_METHODS
define only methods that can be used globally, but not adding it to view automatically. One more thingCORS_ORIGIN_ALLOW_ALL
must be boolean, not string. – PunctualModelViewset
? the delete method is working in the test so the view must allow it but the CORS headers are not updated in the response (what I thoughdjagno-cors-header
is supposed to do ... ) – Doherty