←back to thread

Happy 20th Birthday, Django

(www.djangoproject.com)
578 points davepeck | 7 comments | | HN request time: 0.687s | source | bottom
Show context
Euphorbium ◴[] No.44559640[source]
Fastapi has completely replaced django for me. I do not miss orm at all.
replies(3): >>44559711 #>>44559962 #>>44561110 #
1. lutoma ◴[] No.44559962[source]
I’ve also switched away from Django (to Litestar), but the ORM is the mean thing I keep missing from Django. SQLAlchemy feels really clunky by comparison
replies(2): >>44561669 #>>44562230 #
2. rollcat ◴[] No.44561669[source]
I think the ORM is fine. There's always some friction coming from mapping rows to classes and objects, but you can always drop down a layer and just pull raw tuples.

What I'm not a fan of, is the query DSL. Normally, the developer works to figure out how to express their problem with SQL; then the DB engine works to figure out how to map that SQL to the data it has on disk. Now Django adds another layer, which is completely unlike SQL, has its own unique pitfalls, etc; sometimes I find myself just dumping the raw SQL, working on that to get the result I wanted, then working that back to the DSL.

I think SQLAlchemy gets it right. The query language is a thin veil over SQL, and mapping to objects is an explicit and clear operation. What does feel clunky to me, is setup: SQLAlchemy expects you to bring your own glue; Django is vertically integrated.

replies(2): >>44570628 #>>44573777 #
3. sparkling ◴[] No.44562230[source]
What made you choose Litestar over fastapi (which seems to be the most popular choice right now)?
replies(2): >>44570215 #>>44571027 #
4. lutoma ◴[] No.44570215[source]
Mostly the better documentation (last I checked FastAPI docs felt more like a series of blog posts than actual docs, but maybe that's improved). I also preferred the community-driven approach of Litestar as opposed to FastAPI's BDFL-type development structure.

I think there were also some technical details I liked better about Litestar where it was more explicit about things while FastAPI was more "opaque magic happening in the background", but to be honest I don't remember all of those.

5. vFunct ◴[] No.44570628[source]
This is my pain point in Django as well, the query DSL. 10+ years with Django and I still don't know how it's supposed to work, given it's all done within the namespace of a function call.

Fortunately, I now have AI to write any Django queries for me.

6. robertlagrant ◴[] No.44571027[source]
We chose Litestar over FastAPI mostly because they seemed very similar, but Litestar had a more distributed governance; i.e. a larger bus factor.

We are jealous of some FastAPI features though, so it's possible we could migrate, as Litestar's mapping between domain models, database models and API models isn't as flexible as we'd like.

7. jefurii ◴[] No.44573777[source]
There's nothing stopping you from using Django with SQLAlchemy or even raw SQL.