176

Django: what’s new in 6.0

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.

5 hours agoteagee

OP here, thanks for the praise!

Yeah, I mentioned Celery due to its popularity, no other reason ;)

4 hours agoadamchainz

You are a great writer - thanks for putting this together!

3 hours agoryanisnan

I'm of the opinion that django task apps should only support a single backend. For example, django-rq for redis only. There's too many differences in backends to make a good app that can handle multiple. That said, I've only used celery in production before, and I'm willing to change my mind.

4 hours agojonatron

I’m currently stuck with the tech debt of Celery myself. I understand that! Does Django Tasks support async functions?

2 hours agoblorenz

Why is celery awful?

4 hours agohintoftime

Celery is great and awful at the same time. In particular, because it is many Python folks' first introduction to distributed task processing and all the things that can go wrong with it. Not to mention, debugging can be a nightmare. Some examples:

- your function arguments aren't serializable - your side effects (e.g. database writes) aren't idempotent - discovering what backpressure is and that you need it - losing queued tasks during deployment / non-compatible code changes

There's also some stuff particular to celery's runtime model that makes it incredibly prone to memory leaks and other fun stuff.

Honestly, it's a great education.

an hour agoakoumjian

It's okay till it's not. Everyone I know who had Celery in production was looking for a substitution (custom or third-party) on a regular basis. Too many moving pieces and nuances (config × logic × backend), too many unresolved problems deep in its core (we've seen some ghosts you can't debug), too much of a codebase to understand or hack. At some point we were able to stabilize it (a bunch of magic tricks and patches) and froze every related piece; it worked well under pressure (thanks, RabbitMQ).

an hour agoleobuskin

Because it’s a seducer. It does what you need to do and you two are happy together. So you shower more tasks on Celery and it becomes cold and non-responsive at random times.

And debugging is a pain in the ass. Most places I’ve been that have it, I’ve tried to sell them on adding Flower to give better insight and everyone thinks that’s a very good idea but there isn’t time because we need to debug these inscrutable Celery issues.

https://flower.readthedocs.io/en/latest/

2 hours agotclancy

Computer, load up Celery Man please.

3 hours agognatman

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.

6 hours agogiancarlostoro

The most obvious value here is for HTMX, which requires a lot of partial templates.

2 hours agoapothegm

Amazing that Django didn't have this until 2025

16 minutes agopier25

Key benefit for reusability and composability in React is IMHO that they don't use templates at all, but everything is a function.

4 hours agolittlecranky67

React allows for encapsulation of state in a reusable component, its more than just templating.

5 hours agosquidsoup

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

5 hours agochistev

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...

5 hours agoteagee

I'm an avid HTMX user but never did I ever think "I'm using so many includes, I wish I didn't have to use include so much."

What I would like is a way to cut down the sprawl of urls and views.

5 hours agoThe_Fox

I do a check for `request.htmx` in my views and conditionally return a template partial as needed. This reduced my need for one-off view functions that were only returning partials for htmx. Works pretty well from my experience.

4 hours agoadparadox

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.

3 hours agoWD-42

indeed the vintage templating was a logical bottleneck

5 hours agoagumonkey

How is it different from include? Just less files from my perspective

5 hours agof311a

The "inline partials" feature is neat, means you can use and define a partial at the same time.

The way you can render just a named partial from both the render() shortcut and the include tag is nice too:

https://docs.djangoproject.com/en/6.0/ref/templates/language...

5 hours agosimonw

Yeah, but I was doing the same thing 10 years ago with include mixed with extends and blocks. I can just include a file inside a template or render it directly.

5 hours agof311a

I asked the same question

5 hours agochistev

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?

2 hours agowahnfrieden

[flagged]

5 hours agojasoncartwright

Well, https://en.wikipedia.org/wiki/Nonce_word

It makes me sad when a secondary meaning, which does not even overcome the main meaning in usage, becomes an obstacle for the normal use of a word. It's like seeing a rainbow as a sexualized symbol not fit for children, because it also happens to be used by LGBTQ+ community. (BTW, since you're a Brit: did people stop using the word "fag" to refer to a cigarette?)

5 hours agonine_k

I mean, it is sad. But unfortunately that is what happened with "master", "slave", "whitelist", and "blacklist". No reasonable person construed these as offensive or having any implications about the wider world. But there are people in our profession who are determined to take offense where none is given, and unfortunately they got their way.

4 hours agobigstrat2003

Well, "slave" has a pretty direct main meaning of an oppressed person doing forced labor. The word "master" is much milder in this regard (compare "master's degree" and "slave's degree"). The word "nonce" in normal usage seems even more removed from any pejorative secondary meanings.

3 hours agonine_k

We don't need to bring this kind of thing up. We're not school children and most of us are technology professionals, so the meaning is clear.

These guidelines are relevant here:

Eschew flamebait. Avoid generic tangents. Omit internet tropes.

Please don't pick the most provocative thing in an article or post to complain about in the thread. Find something interesting to respond to instead.

Please don't complain about tangential annoyances—e.g. ... name collisions ... . They're too common to be interesting.

https://news.ycombinator.com/newsguidelines.html

4 hours agotomhow

American hegemony, and all that.

5 hours agotdfirth

In the US they spell it as nonze.

5 hours agofirecall

No we don't.

4 hours agolagniappe

Pretty positive that was a joke/bait…

4 hours agonophunphil

It absolutely was a joke

Slightly absurdist non-sensical humour I’ll admit, but none the less, a joke :-)

an hour agofirecall

https://en.wikipedia.org/wiki/Context

4 hours agodiath

That didn't stop people from throwing a fit over master-slave terminology in software (having nothing to do with slavery), going so far as to rename long-standing development branch names, as well as put significant effort into removing such terms from the code itself and any documentation.