[Django] #35080: Reconsideration of HTTP Method Integration in Django for Enhanced HTMX Compatibility and similar frontend expe

23 views
Skip to first unread message

Django

unread,
Jan 2, 2024, 5:36:26 AM1/2/24
to django-...@googlegroups.com
#35080: Reconsideration of HTTP Method Integration in Django for Enhanced HTMX
Compatibility and similar frontend expe
-------------------------------------+-------------------------------------
Reporter: code-on | Owner: nobody
Type: New | Status: new
feature |
Component: | Version: dev
Uncategorized | Keywords: htmx, hx-delete,
Severity: Normal | hx-post, request.POST,
Triage Stage: | request.DELETE, request.PATCH
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I am reaching out to propose a reconsideration of Django's current
handling of HTTP methods, specifically in the context of modern web
development practices and the growing adoption of libraries such as HTMX.

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.

Django

unread,
Jan 2, 2024, 5:54:45 AM1/2/24
to django-...@googlegroups.com
#35080: Reconsideration of HTTP Method Integration in Django for Enhanced HTMX
Compatibility and similar frontend expe
-------------------------------------+-------------------------------------
Reporter: code-on | Owner: nobody
Type: New feature | Status: closed
Component: Uncategorized | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: htmx, hx-delete, | Triage Stage:
hx-post, request.POST, | Unreviewed
request.DELETE, request.PATCH |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* 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>

Reply all
Reply to author
Forward
0 new messages