Django: what’s new in 6.0
Posted by rbanffy 6 days ago
Comments
Comment by emzo 6 days ago
Comment by Induane 6 days ago
Probably the wrong time or place but I am also on the market literally as of yesterday so if anyone is looking for an experienced Django guy, I'm your man! oldspiceap@gmail.com
Comment by teagee 6 days ago
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.
Comment by tmarice 6 days ago
There are bugs and issues, but because so many people are using it, you’re rarely the first to stumble upon a problem. We processed double-digit millions of messages daily with Celery + RabbitMQ without major obstacles. Regardless of what people say, it should be your first go-to.
Comment by formerly_proven 6 days ago
Comment by rbanffy 6 days ago
I often prefer designing around explicit queues and building workers/dispatchers. One queuing system I miss is the old Google App Engine one - you set up the queue, the URL it calls with the payload (in your own app), the rate it should use, and that's it.
Comment by adamchainz 6 days ago
Yeah, I mentioned Celery due to its popularity, no other reason ;)
Comment by ryanisnan 6 days ago
Comment by boxed 6 days ago
Fundamentally I think the entire idea behind celery and django-q is mostly misguided. People normally actually need a good scheduler and a bring-your-own queue in tables that you poll. I wrote Urd to cover my use cases and it's been rock solid.
Comment by sgt 6 days ago
I also use Kafka on other tech stacks but that's another level completely and use case.
Comment by hintoftime 6 days ago
Comment by JimDabell 6 days ago
— https://steve.dignam.xyz/2023/05/20/many-problems-with-celer...
> The problems with (Python’s) Celery:
— https://docs.hatchet.run/blog/problems-with-celery
> Dramatiq motivation:
— https://dramatiq.io/motivation.html
Here are some alternatives:
Dramatiq: https://github.com/Bogdanp/dramatiq
Comment by hintoftime 6 days ago
https://news.ycombinator.com/item?id=45797228
https://python-absurd-client.readthedocs.io/en/latest/quicks...
Comment by meesles 6 days ago
Comment by hda111 6 days ago
Comment by leobuskin 6 days ago
Comment by tclancy 6 days ago
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.
Comment by sgt 6 days ago
Comment by freedomben 6 days ago
Comment by sgt 5 days ago
Comment by akoumjian 6 days ago
- 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.
Comment by ffsm8 6 days ago
What does idempotent mean in this context, or did you mean atomic/rollback on error?
I'm confused because how could a database write be idempotent in Django? Maybe if it introduced a version on each entity and used that for crdt on writes? But that'd be a significant performance impact, as it couldn't just be a single write anymore, instead they'd have to do it via multiple round trips
Comment by jon-wood 6 days ago
Comment by 7bit 6 days ago
Comment by SkyArrow 6 days ago
Comment by hintoftime 6 days ago
Comment by hintoftime 6 days ago
Comment by teaearlgraycold 6 days ago
Comment by saaspirant 6 days ago
Comment by boxed 6 days ago
Task queues are like email. It's what everyone is used to so people ask for more of it, but it's not actually good/the right tool.
Comment by leobuskin 6 days ago
Comment by walthamstow 6 days ago
Comment by blorenz 6 days ago
Comment by gnatman 6 days ago
Comment by jonatron 6 days ago
Comment by aynyc 6 days ago
Comment by meesles 6 days ago
Comment by JodieBenitez 6 days ago
Comment by aynyc 6 days ago
Comment by dontlaugh 6 days ago
Comment by sgt 6 days ago
Comment by aynyc 6 days ago
Comment by WesleyJohnson 5 days ago
manage.py makemigrations myapp --empty --name add_some_view
(in the migration file) operations=[migrations.RunSQL("Create View some_view AS ....", "DROP VIEW IF EXISTS...."]
(in your models.py) class SomeView(models.Model):
class Meta:
db_table = 'some_view'
managed = False
manage.py makemigrations myapp --name add_some_view_modelComment by sgt 5 days ago
Comment by luxcem 6 days ago
Comment by formerly_proven 6 days ago
Comment by WD-42 6 days ago
Comment by melvinroest 6 days ago
Comment by aynyc 6 days ago
Comment by giancarlostoro 6 days ago
Comment by littlecranky67 6 days ago
Comment by globular-toast 6 days ago
* https://pypi.org/project/fast_html/
* https://fastht.ml/ (different to above, I think)
* https://github.com/volfpeter/fasthx
Probably others. I strongly prefer this to templating, but I find it makes dyed in the wool Django people squirm.
Comment by dontwannahearit 6 days ago
A jinja/django template has an implicit context but for nested functions you really have to pass that context down through every function call.
It inevitably ends up just a big dict blob.
You get some typing support in an IDE but nothing really for function parameters.
Maybe I am doing wrong?
Comment by pelme 6 days ago
Comment by graemep 6 days ago
Comment by Induane 6 days ago
The downside is I find them hard to read.
I think the template approach isn't quite right and yet neither is the functional approach.
At the end of the day these are a type of tree structure; I think we could conjure a new mechanism that gets the best of most/both worlds.
Comment by globular-toast 6 days ago
To be honest my main problem with templates is they have to be one per file. In principle there's no difference between naming a new file and naming a function, but in practice it just sucks. It's a higher barrier so people are less likely to write smaller components, and refactoring support completely sucks. Even renaming a template is a massive pain whereas renaming a function with decent LSP support is easy.
JSX hits that perfect balance between readability while still being regular functions. Maybe something is possible with the new 3.13 template strings?
Comment by apothegm 6 days ago
Comment by squidsoup 6 days ago
Comment by renegade-otter 6 days ago
Everyone just busts out "React" for every small thing, but few commit to actually learning this pretty complicated technology.
The last two recent Cloudflare outages were because of React.
Comment by Iwan-Zotow 5 days ago
Comment by simonw 6 days ago
Comment by wahnfrieden 6 days ago
Comment by JodieBenitez 6 days ago
Comment by wahnfrieden 6 days ago
Comment by JodieBenitez 6 days ago
There is something very appeasing in just pulling Django and have all the basics covered. It's nice to have options when needed though.
Comment by pier25 6 days ago
Comment by simonw 6 days ago
Comment by Hamuko 6 days ago
Comment by sgt 6 days ago
Comment by Hamuko 5 days ago
>Jinja2 can offer performance improvements, particularly when it comes to speed.
https://docs.djangoproject.com/en/6.0/topics/performance/#al...
Comment by chistev 6 days ago
Comment by teagee 6 days ago
https://adamj.eu/tech/2025/12/03/django-whats-new-6.0/#rende...
Comment by The_Fox 6 days ago
What I would like is a way to cut down the sprawl of urls and views.
Comment by adparadox 6 days ago
Comment by WD-42 6 days ago
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.
Comment by JodieBenitez 6 days ago
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.
Comment by agumonkey 6 days ago
Comment by f311a 6 days ago
Comment by simonw 6 days ago
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...
Comment by f311a 6 days ago
Comment by agumonkey 6 days ago
Comment by chistev 6 days ago
Comment by jamesbfb 6 days ago
Comment by viiralvx 6 days ago
Also, good to see first class support for Tasks, among a lot of other niceties!
Comment by sgt 6 days ago
https://github.com/RealOrangeOne/django-tasks
Is that correct?
Comment by selcuka 6 days ago
Comment by sgt 6 days ago
Has there been discussion about adopting/embedding django-tasks into Django 6.x?
Comment by adamchainz 5 days ago
Comment by bigthymer 6 days ago
https://guides.rubyonrails.org/layouts_and_rendering.html#pa...
Comment by ChrisArchitect 6 days ago
Comment by manthangupta109 6 days ago
Comment by kissgyorgy 6 days ago
Comment by renegade-otter 6 days ago
I am not roasting it or anything, go Django, but just an observation.
Comment by gurraman 6 days ago
Comment by xnorswap 6 days ago
Not just the Framework -> Core migration itself, but the power to make breaking changes went to their heads, and they started quickly tearing up everything only to change their minds again, such as a short-lived "project.json" syntax.
Django is exactly the technology I'd pick if I wasn't already super familiar with the .NET stack. It's got the "batteries included" feel without the chaotic confusion of a million ways to do things. It doesn't have the breaking changes churn that happens elsewhere too.
Comment by renegade-otter 6 days ago
Comment by anticodon 6 days ago
Comment by renegade-otter 6 days ago
Nothing wrong with that. One had to start somewhere.
Comment by mentos 6 days ago
Comment by boxed 6 days ago
Comment by tirpen 6 days ago
I get remarkably good and correct LLM output for Django projects compared to what I get in project with more fast moving and frequently API breaking frameworks.
Comment by vanschelven 6 days ago
Comment by Genego 6 days ago
Comment by m_ke 6 days ago
Comment by kristianp 5 days ago
Edit, it's about 37%, and python-only. https://arxiv.org/pdf/2310.06770v3
Comment by jasoncartwright 6 days ago
Comment by tomhow 6 days ago
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.
Comment by nine_k 6 days ago
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?)
Comment by jasoncartwright 6 days ago
> did people stop using the word "fag" to refer to a cigarette?
Yes, seems so. I've not heard that in at least a decade
Comment by bigstrat2003 6 days ago
Comment by nine_k 6 days ago
Comment by nine_k 6 days ago
Comment by jasoncartwright 6 days ago
Comment by tdfirth 6 days ago
Comment by firecall 6 days ago
Comment by lagniappe 6 days ago
Comment by nophunphil 6 days ago
Comment by firecall 6 days ago
Slightly absurdist non-sensical humour I’ll admit, but none the less, a joke :-)
Comment by nophunphil 6 days ago
Comment by diath 6 days ago
Comment by harshreality 6 days ago