Live data from Hacker News

Django: what’s new in 6.0

adamj.eu

71–80 of 127 posts

Re: Django: what’s new in 6.0

#71

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.

React also requires you to know the long list of do's and dont's and is littered with minefields that most average developers are not even aware of.

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.

Re: Django: what’s new in 6.0

#72

Earlier quoted context omitted.

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

Exactly. There are a few libraries to achieve a similar thing in Python: * https://htpy.dev/ * 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.

There are a lot of cool things about these, one that they are less typo prone and also they are often much faster.

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.

Re: Django: what’s new in 6.0

#74
post #3

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.

Celery is the worst background task framework, except for all the others.

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.

Re: Django: what’s new in 6.0

#75
post #58

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.

What a lot of people don’t know is that SWE-bench is over 50% Django code, so all of the top labs hyper optimize to perform well on it.

Re: Django: what’s new in 6.0

#76
post #45

Earlier quoted context omitted.

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…

> your side effects (e.g. database writes) aren't idempotent 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 d…

In the context of background jobs idempotent means that if your job gets run for a second time (and it will get run for a second time at some point, they all do at-least-once delivery) there aren't any unfortunate side effects to that. Often that's just a case of checking if the relevant database updates have already been done, maybe not firing a push notification in cases of a repeated job.

Re: Django: what’s new in 6.0

#77

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 think it is refreshing. They don't half-ass things into the framework. They take the time to do it right. They let every feature fight for its life, and put their effort into LTS and minimizing number of issues and API changes related to the features they do deliver. As a developer I really appreciate this. I don't have to totally rewrite my entire application every new version because the implementation wasn't properly thought through.

Re: Django: what’s new in 6.0

#78
post #59

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.

Same! I've been using it since pre-1.0 and love it. I am currently a few blocks away from it's birthplace.

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

Re: Django: what’s new in 6.0

#79
post #69
post #55

Earlier quoted context omitted.

If I understood correctly, to use Tasks in production right now you need to use this as well: https://github.com/RealOrangeOne/django-tasks Is that correct?

Correct. Django 6.0 comes with a standardised API, with 2 testing backends (ImmediateBackend and DummyBackend). You need a third-party backend to store and execute tasks.

Good to know. So no need for Django Q2 or Celery anymore either. I guess unless one has a specific reason.

Has there been discussion about adopting/embedding django-tasks into Django 6.x?

Re: Django: what’s new in 6.0

#80

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 think it is refreshing. They don't half-ass things into the framework. They take the time to do it right. They let every feature fight for its life, and put their effort into LTS and minimizing number of issues and API changes related to the features they do deliver. As a developer I really appreciate this. I don't have to totally rewrite my entire application every new version because the implementation wasn't pro…

That is indeed - rare, and one of the reasons I am wary of heavy frameworks. You buy into its code AND its legacy.
Post reply on HN