django - HTTPS PUT Request using djangorestframework -
i trying send https put request restful api django web service using djangorestframework (drf: http://django-rest-framework.org/ ) view. cannot work due django's cross site request forgery (csrf) protection. the put request intended allow unauthenticated users add resource. what have considered/tried: disabling csrf -- not acceptable. api runs on same django instance non-api service. disabling csrf protection risk. using x-requested-with: xmlhttprequest header on put request (i control clients). doesn't work -- still csrf error. using @crsf_exempt decorator on put view. if -- framework defines class, not view. my current best option write put views myself without using drf's view class. can use @crsf_exempt decorator successfully. i'd use drf's view class -- cannot see how. can you? thanks james cran wellward, able solve issue using method_decorator. class exampleview(responsemixin,view): renderers=default_renderers def get(self,request): response=...