#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018cc9beeecc-392eaa47-3bba-469d-9df3-05305997d3e9-000000%40eu-central-1.amazonses.com.