adamchainz / django-htmx

Extensions for using Django with htmx.
https://django-htmx.readthedocs.io/
MIT License
1.57k stars 140 forks source link

htmx decorator #147

Closed rtpm closed 2 years ago

rtpm commented 2 years ago

Description

Hello, maybe you could add a htmx decorator which renders different template if using TemplateResponse in the view ?

Here's an example, from Luke's repo: https://gitlab.com/learnscripture/learnscripture.net/-/blob/master/learnscripture/decorators.py#L80

Thanks!

adamchainz commented 2 years ago

There are many approaches to partial rendering. I don't want to encode just one of them in a decorator or CBV. I want to keep this library restricted to htmx-level stuff that you can build your own helpers out of if you wish.