MCPcopy
hub / github.com/django/django / http_method_not_allowed

Method http_method_not_allowed

django/views/generic/base.py:145–162  ·  view source on GitHub ↗
(self, request, *args, **kwargs)

Source from the content-addressed store, hash-verified

143 return handler(request, *args, **kwargs)
144
145 def http_method_not_allowed(self, request, *args, **kwargs):
146 response = HttpResponseNotAllowed(self._allowed_methods())
147 log_response(
148 "Method Not Allowed (%s): %s",
149 request.method,
150 request.path,
151 response=response,
152 request=request,
153 )
154
155 if self.view_is_async:
156
157 async def func():
158 return response
159
160 return func()
161 else:
162 return response
163
164 def options(self, request, *args, **kwargs):
165 """Handle responding to requests for the OPTIONS HTTP verb."""

Calls 3

_allowed_methodsMethod · 0.95
log_responseFunction · 0.90