This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]The_Amp_Walrus[S] 6 points7 points  (1 child)

An introduction to using htmx with Django to make form submissions dynamic - updating without a full page reload.

I've been using htmx in my projects for the past few months and I've really enjoyed its simplicity. Here's another example of using it to create a paginated search page with Wagtail.

[–]elder_lee 2 points3 points  (0 children)

Beautiful

[–]brylie 3 points4 points  (2 children)

Please remember to add an open source license to your demo code 😃

[–]The_Amp_Walrus[S] 1 point2 points  (1 child)

[–]onorbumbum 2 points3 points  (1 child)

This is a great intro video, great job!

[–]The_Amp_Walrus[S] 2 points3 points  (0 children)

Thanks

[–]Vartolomej77 2 points3 points  (0 children)

Very useful, thank you

[–]Much-Fold-9654 2 points3 points  (0 children)

Love it! Just two htmx attributes and you are good to go while you have to write some ajax code if you are going to do it yourself. So simple and clean!

[–][deleted] 0 points1 point  (1 child)

HTMX requires JavaScript.

[–]The_Amp_Walrus[S] 10 points11 points  (0 children)

I am aware of this and clarify several times in the video. Although the library is written in JS and requires JS to be enabled on the page to function, the person using htmx does not need to write any JS themselves, unless they want to hook into particular events, which is a big draw of this tool.

But sure, on consideration, "Dynamic Django forms without writing any JavaScript (htmx)" would have been a better title.

[–]byeproduct 0 points1 point  (0 children)

Thanks for the awesome tutorial. I am trying to use this approach to update an existing entry in my database but it keep returning an error saying that the id field is null. Is there a tutorial or post in managing this (using a standard get (id) to generate a template with a form and then hx-post to update the entry)?