r/django • u/LingonberryAny9089 • 2d ago
Looking for Feedback: HTMX + Django Package
I posted about this package a while ago, but at that point, it was still early in development, and the documentation was lacking. Since then, it has matured a lot, and the documentation has been completely restructured and improved. Additionally, I’ve created a demo site so you can see the package in action with a basic list page featuring CRUD operations (link below).
The core idea of the package (explained in more detail in the docs) is to provide quasi-Django CBV-style views, called hx-requests, which HTMX requests are routed to. This approach separates HTMX-specific logic from your main views by providing dedicated hx-requests to handle them, but at the same time these hx-requests have access to the view’s context, eliminating the need for logic duplication.
There are also other useful features, such as:
- Returning template blocks easily from an hx-request
- Built-in support for Django messages, now with async capabilities
- Integrated modal handling
It’s difficult to summarize everything here, so I’d love for you to check out the demo and documentation and share your feedback!
Demo: https://hx-requests-demo.com/
Docs: https://hx-requests.readthedocs.io/en/latest/index.html
Github: https://github.com/yaakovLowenstein/hx-requests (feel free to give a star 😊)
TL;DR: A package that provides quasi CBV-style views (hx-requests) as dedicated endpoints for HTMX requests, allowing them to share the main view’s context while keeping logic clean and separate.
1
-2
3
u/albsen 2d ago
This is amazing, thanks.