mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Add 'patch' http method support to the Django View object
This commit is contained in:
parent
35f72cecb1
commit
4f96951be9
|
@ -90,6 +90,12 @@ else:
|
|||
update_wrapper(view, cls.dispatch, assigned=())
|
||||
return view
|
||||
|
||||
# Taken from @markotibold's attempt at supporting PATCH.
|
||||
# https://github.com/markotibold/django-rest-framework/tree/patch
|
||||
http_method_names = set(View.http_method_names)
|
||||
http_method_names.add('patch')
|
||||
View.http_method_names = list(http_method_names) # PATCH method is not implemented by Django
|
||||
|
||||
# PUT, DELETE do not require CSRF until 1.4. They should. Make it better.
|
||||
if django.VERSION >= (1, 4):
|
||||
from django.middleware.csrf import CsrfViewMiddleware
|
||||
|
|
Loading…
Reference in New Issue
Block a user