In this post we take advantage of HTMX requests to do partial rendering for list views in Django. Django on Fly.io is pretty sweet! Check it out: you

A 'No JS' Solution for Dynamic Search in Django

submited by
Style Pass
2023-03-15 15:00:03

In this post we take advantage of HTMX requests to do partial rendering for list views in Django. Django on Fly.io is pretty sweet! Check it out: you can be up and running on Fly.io in just minutes.

Django is one of the most used server-side frameworks out there. It uses MTV (Model-Template-View) design pattern to build highly scalable and maintainable apps.

Even though Django is a very versatile framework, one of the things that annoys me the most is the fact that - for a minimal Django setup - it reloads the entire page to get a response. What if we could render individual parts of the HTML page instead of having to reload everything?

The first straightforward option we can think of is to use Javascript (JS). But since we all love Django and probably want to avoid having to write some JS code, I'd like to share with you another way: HTMX!

HTMX is a library created to allow us to use modern browser features - like partial rendering - directly from our HTML, rather than using Javascript. Cool, right? That's what we are looking for.

Leave a Comment