I understand that a similar request was previously declined (referenced in
Django Ticket #12635 https://code.djangoproject.com/ticket/12635).
However, the landscape of web development has significantly evolved since
then. The integration of explicit HTTP methods such as DELETE, POST,
PATCH, and PUT could greatly enhance Django's compatibility with HTMX and
similar libraries.
At present, Django views support methods like post, get, delete, and
patch. However, integrating these methods with HTMX often leads to a
suboptimal experience. This is partly due to the necessity of parsing
request.body to access the transmitted values. Frameworks like Django Rest
Framework (DRF) and other frontend libraries provide a more direct
handling of these HTTP methods.
By supporting these HTTP methods more explicitly, Django could enable
cleaner and more efficient code, particularly in the context of class-
based views. This change would reduce the need for creating multiple URLs
and separate functions for different HTTP methods.
Als for new people to django it makes things more clear if the missing
request.DELETE and request.PATCH, PUT are there.
--
Ticket URL: <https://code.djangoproject.com/ticket/35080>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => wontfix
Comment:
Thanks for this ticket, however, as far as I'm aware, you're proposing a
(potentially backward incompatible) change in the way how Django handles
HTTP request/response cycle. Such changes should first be discussed in
detail on the Django Forum (or DevelopersMailingList), where you'll reach
a wider audience and see what other think. Moreover, you should have a
plan how to implement this, what kind of changes are needed, and how to
implement them without violating out stability policy. Also, please
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features follow the guidelines with regards to
requesting features].
I've noticed that you also created an [https://github.com/adamchainz
/django-htmx/issues/408 issue] in `django-htmx`. For the future, I'd
recommend waiting for a reply instead of creating upstream tickets.
> "By supporting these HTTP methods more explicitly"
For example, I'm not really sure what do you mean by that.
--
Ticket URL: <https://code.djangoproject.com/ticket/35080#comment:1>