Live data from Hacker News

Django: what’s new in 6.0

adamj.eu

41–50 of 127 posts

Re: Django: what’s new in 6.0

#41
post #18

Earlier quoted context omitted.

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

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

Re: Django: what’s new in 6.0

#43

Earlier quoted context omitted.

Why is celery awful?

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?

Re: Django: what’s new in 6.0

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

Why is celery awful?

> The Many Problems with Celery:

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

RQ: https://github.com/rq/rq

Huey: https://github.com/coleifer/huey

Hatchet: https://github.com/hatchet-dev/hatchet

Re: Django: what’s new in 6.0

#45

Earlier quoted context omitted.

Why is celery awful?

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 do it via multiple round trips

Re: Django: what’s new in 6.0

#46

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?

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

Re: Django: what’s new in 6.0

#47
post #8

Earlier quoted context omitted.

indeed the vintage templating was a logical bottleneck

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

you're kinda right, {% partial ... %} vs {% include ... %} is not a big difference, but my mind was vaguely thinking that "includes" have often been seen as large templates, whereas partial have been after the component era with the idea of making small blocks. (my 2 cents)

Re: Django: what’s new in 6.0

#48
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'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.

With that logic, the Django orm should only support one database.

Re: Django: what’s new in 6.0

#49
post #12

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.

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

It's just syntactic sugar, making life a bit easier for HTMX users (cf. "htmx was the main motivation for this feature").

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.

Re: Django: what’s new in 6.0

#50

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.

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?

https://django-cotton.com/ is component-based. I used it a bit, it's nice if you're used to the ways of front-end frameworks, I guess.
Post reply on HN