MCPcopy
hub / github.com/django/django / HttpResponseNotAllowed

Class HttpResponseNotAllowed

django/http/response.py:709–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707
708
709class HttpResponseNotAllowed(HttpResponse):
710 status_code = 405
711
712 def __init__(self, permitted_methods, *args, **kwargs):
713 super().__init__(*args, **kwargs)
714 self["Allow"] = ", ".join(permitted_methods)
715
716 def __repr__(self):
717 return "<%(cls)s [%(methods)s] status_code=%(status_code)d%(content_type)s>" % {
718 "cls": self.__class__.__name__,
719 "status_code": self.status_code,
720 "content_type": self._content_type_for_repr,
721 "methods": self["Allow"],
722 }
723
724
725class HttpResponseGone(HttpResponse):

Callers 7

innerFunction · 0.90
async_generic_viewMethod · 0.90
trace_viewFunction · 0.90
test_not_allowedMethod · 0.90
test_not_allowed_reprMethod · 0.90

Calls

no outgoing calls

Tested by 4

async_generic_viewMethod · 0.72
test_not_allowedMethod · 0.72
test_not_allowed_reprMethod · 0.72