| 707 | |
| 708 | |
| 709 | class 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 | |
| 725 | class HttpResponseGone(HttpResponse): |
no outgoing calls