[Docs] Clarify behavior of View.http_method_not_allowed default implementation

This commit is contained in:
Zubair Hassan 2025-11-16 16:18:31 +05:00
parent 2acee1e68b
commit e7487f6eb4

View file

@ -113,11 +113,11 @@ ancestor classes are documented under the section title of **Ancestors
If the view was called with an HTTP method it doesn't support, this If the view was called with an HTTP method it doesn't support, this
method is called instead. method is called instead.
The default implementation returns ``HttpResponseNotAllowed`` with status code **405 Method Not Allowed**. The default implementation returns ``HttpResponseNotAllowed`` with
status code **405 Method Not Allowed**.
**Note:** The response **does not include the allowed methods in the body**. **Note:** Django sets the list of allowed HTTP methods in the ``Allow``
Instead, Django sets the list of allowed HTTP methods in the ``Allow`` response header, response header, and the response content is empty.
and the response content is empty.
.. method:: options(request, *args, **kwargs) .. method:: options(request, *args, **kwargs)