20 comments

[ 6.0 ms ] story [ 36.6 ms ] thread
Template partials look good, which is one of the key reasons frameworks like React are as good and popular as they are, because you can reuse small segments of code.
React allows for encapsulation of state in a reusable component, its more than just templating.
indeed the vintage templating was a logical bottleneck
But you could already reuse templates in Django by including them. What am I missing?
Key benefit for reusability and composability in React is IMHO that they don't use templates at all, but everything is a function.
There've been a variety of open source attempts at this idea. Is this official one now the best to use, or are the others still compelling?
The most obvious value here is for HTMX, which requires a lot of partial templates.
Amazing that Django didn't have this until 2025
Any code or blog written by Adam is worth spending some time on.

It will be interesting to see how the tasks framework develops and expands. I am sad to see the great Django-Q2 lumped in with the awful Celery though.

Template Partials and HTMX seems like the Django equivalent of View Components and Stimulus for Rails, which is nice.

Also, good to see first class support for Tasks, among a lot of other niceties!

Given that Python tends to produce fewer hallucinations when generated by LLMs I wonder if former Django developers using AI tools are secretly having a blast right now.
I love how Django just keeps slowly improving at every release. 6.0 is especially cool, including lots of really useful new features. Who said dependable tech was dull - this is the way is should be done. Well done all who contribute.
Dude, I used Django at 1.x - before they even had an ORM. The fact that it is adding a way to run tasks, almost a quarter of a century later, is wild to me.

I am not roasting it or anything, go Django, but just an observation.

I find templates atrocious to use for component fragments like this, that's why I wrote a Python component library when I started using Django with HTMX. Order of magnitude more pleasant to use, works with _every_ Python web framework not just Django: https://compone.kissgyorgy.me/
I've been using Django on and off at work for the past few years. I really like it. That being said, I still find its ORM difficult. I understand it now that since it's an opinionated framework, I need to follow Django way of thinking. The main issue is that at work, I have multiple databases from different business units. So I constantly have to figure out a way to deal with multiple databases and their idiosyncrasies. I ended up doing a lot of hand holding by turning off managed, inspectdb and then manually delete tables I don't want to show via website or other reasons. For green webapps we have, django is as good as it gets.
I’m very much an Odoo guy who has dabbled with Django (and notably, celery in the past) but as someone who makes huge use of the Odoo OCA queue module[0], I never understood why Django never made use of the Postgres LISTEN/NOTIFY to offload tasks. Maybe this is my misunderstanding as I’m pretty green with the Django ecosystem as a whole.

[0] https://github.com/oca/queue

I have been using Django on and off for the last 5-6 years, and it does have the advantage of having batteries loaded but it just feel heavy overall