Hacker News new | ask | show | jobs
by bkovacev 523 days ago
What seems to differentiate django-ninja over Flask or FastAPI or any Starlette derivative? You mention lightweight as well, can you expand further?
1 comments

Ninja lets you use django. There's less config vs DRF
Aside from the obvious that ninja let's you use django.
The ability to use django is the main attractor. The other frameworks are great but make you reinvent Django if you require auth, orm, admin, etc
That would have been my argument exactly - I am not saying that Django fits every use case, but with my limited exposure to projects that have ended up using non-Django Python API framework, they ended up recreating the batteries included approach, with probably way too many issues waiting to be discovered with manually rolled out auth, middlewares and ORM.
It's such a shame Pyramid isn't more popular. I think you'll find what they have recreated is not Django, it's Pyramid.

The thing is, Django isn't just a web framework. Django is a CRUD app framework. It's great for building CRUD apps, but that's about it. In other words, it makes the easy stuff easy, but doesn't help with the hard stuff (in fact, it often hinders it).

I think the real reason for using Django is the "app" ecosystem. You wouldn't be able to get Django-style packages with Pyramid. It's possible with Django, though, because it's a CRUD app framework.

If you're not using "apps" then I guess the only other reason is the community support that you probably won't get from Pyramid + SQLAlchemy or similar.

The apps are a major sell like with any ecosystem. But don't forget you also get a stable, mature project, excellent documentation, a pool of developers, etc.
Oh but you wouldn't reinvent Django, you'd build a properly architected, simple system.
Of course you would.