top | item 32897165

(no title)

tcbasche | 3 years ago

I think most senior or experienced Python developers tend to steer clear of Django.

It's just that you don't hear about it because it's mostly junior / less experienced developers writing about Django online.

edit: having said that, I wish we would be more skeptical of magic frameworks like Django in the Python community at least. Things like 'get_object_or_404'[1] should be burned to the ground.

[1] https://docs.djangoproject.com/en/4.1/topics/http/shortcuts/...

discuss

order

mwcampbell|3 years ago

> Things like 'get_object_or_404'[1] should be burned to the ground.

Why? A shortcut like that is useful all the time when writing URL handlers (views in Django).

tcbasche|3 years ago

What does the object have to do with http status codes? It completely entangles the HTTP layer with the database model.

vault|3 years ago

So we should also get rid of `.orElseThrow()` (by default a `NoSuchElementException`)?

tcbasche|3 years ago

If it was .orElseReturn404 then yeah. My point is HTTP codes have no place outside of HTTP endpoints

cutler|3 years ago

Sweeping generalisation or what?