I build a small application, and for the first time I used htmx. Unfortunately I must not show you anything, but the htmx library (combined with Bootstrap5) is fun.
Did you use Django for the backend?
If so, was there anything noteworthy about your app? Any strange things with integrating Django and htmx?
I’ve had some interest in htmx too, but I haven’t hit a use case for it yet so I’ve not tried it out.
htmx works like documented. And questions at Stackoverflow with this tag get answered soon.
I had one small issue: If you want a snippet to do a full-page reload, then the server should send a special http header. But the status code should be 200 (not 302 like in my first implementation).
I documented this here: https://stackoverflow.com/a/65569741/633961
For me htmx is like a straight line. The shortest way to get from A to B. Don’t ask me why it took me so long that to discover that something like this is missing.
I am happy to see HTMX getting some love here. I had a short conversation on reddit about it. Seems there is a lot more interest, so I started a repo to illustrate basic use cases and code samples on using HTMX and Django.
I use IntercoolerJS, the precursor to HTMX, quite extensively on my projects. Conceptually they are the same. The main difference is a bit of syntax and dropping of the jQUERY dependency.
I added htmx to my project and wrote up a quick article to show the configuration I needed for Django (to handle CSRF) as well as an example.
I have created a simple django app to for those who want to play with htmx:
GitHub - adamchainz/django-htmx: Extensions for using Django with htmx. by @adamchainz might be a useful library to integrate Django and
htmx in case folks haven’t seen it before.
I also have a couple example use cases in the example app in the django-htmx repo.
Please spread the good news, so more people can enjoy it.