logoalt Hacker News

chistevyesterday at 10:06 PM3 repliesview on HN

But you could already reuse templates in Django by including them. What am I missing?


Replies

teageeyesterday at 10:07 PM

Check out the HTMX example in the blog, this helped me better understand how it could be used

https://adamj.eu/tech/2025/12/03/django-whats-new-6.0/#rende...

show 1 reply
WD-42yesterday at 11:46 PM

Partialdef inline is the real win. Lets you define parts of a page without needing to place them in another file. Reduces the mental overhead of imagining how the inclusion will look because it’s already there.

The use case is mainly driven by htmx where you will have lots of these partials and the view code renders them as individual responses.

JodieBeniteztoday at 5:41 AM

It's just syntactic sugar, making life a bit easier for HTMX users (cf. "htmx was the main motivation for this feature").

I'm using Unpoly and I just render the whole page and let Unpoly swap the content according to the target selectors, so no need for this. Not much difference in perf if you dont generate gigantic pages with heavy header/footer.