Live data from Hacker News

Django: what’s new in 6.0

adamj.eu

61–70 of 127 posts

Re: Django: what’s new in 6.0

#61

Earlier quoted context omitted.

From your experience, what is a better alternative guys?

There’s no alternative (while prototyping), and anything else is better (when you properly defined your case).

DjangoQ2 is a fine alternative during early development

Re: Django: what’s new in 6.0

#62
post #41

Earlier quoted context omitted.

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.

More to your point, yes, taking offense can be turned into a weapon: https://nassimtaleb.org/2016/08/intolerant-wins-dictatorship...

Amusing to have my throwaway comment replied to with links to earnest points from prominent essayists. Never change, hacker news!

Re: Django: what’s new in 6.0

#63
post #18

[flagged]

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?)

Yes, words have multiple meanings - but only some words are apparently worthy of censorship - which is my point.

> 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

Re: Django: what’s new in 6.0

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

I've been using Celery for years. What is the major issues you have with it and how does Django Q2 help?

I also use Kafka on other tech stacks but that's another level completely and use case.

Re: Django: what’s new in 6.0

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

I tried django-q and I thought it was pretty terrible. The worst was that I couldn't get it to stop retrying stuff that was broken. Sometimes you ship code that does something unexpected, and being able to stop something fast is critical imo.

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.

Re: Django: what’s new in 6.0

#66

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…

From your experience, what is a better alternative guys?

Not the comment that you replied to but I use my own Urd. It's a fancier Cron that you can stop fast. Which is imo what you normally want.

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.

Re: Django: what’s new in 6.0

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

If Python produces less hallucinations it's not because of the syntax, it's because there's so much training data.

Re: Django: what’s new in 6.0

#68
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 my experience async job idempotency is implemented as upserts. Insert all job outputs on the first run. Do (mostly) nothing on subsequent runs. Maybe increment a counter or timestamp.

Re: Django: what’s new in 6.0

#69
post #55

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!

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.

Re: Django: what’s new in 6.0

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

Whenever I saw people complain about LLMs writing code, I never really understood why they were so adamant that it just didn’t work at all for them. The moment I did try to use LLMs outside of Django, it became clear that some frameworks are just much easier to work with LLMs than others. I immediately understood their frustrations.
Post reply on HN