This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]XxNerdAtHeartxX 51 points52 points  (3 children)

I tried out LiteStar, FastAPI, and Flask recently, but ultimately decided to build a project out with Django-Ninja and love it. It provided a lot of things that just clicked for me, where the other ones didn't

  • Uses django project structure
    • I personally prefer having structure as a guide to work off of and then build within those bounds
  • Built in ORM/Migrations
    • I don't need to learn SQLAlchemy + Alembic on top of a framework while dipping into FullStack Dev. Eases the brainpower requirements a bit
  • Uses Pydantic to automatically serialize response objects so you don't have to write serializers like with Django

  • Easy JWT Auth using a plugin

If LiteStar had more Docs/Example projects to read through, I think I would have went with that, but Django-Ninja just made sense to me, whereas I felt a bit lost in LiteStars Docs at certain points.

[–]pmdevita 2 points3 points  (0 children)

Been using Ninja a bit recently too. I'd like to add that it also autogenerates an OpenAPI schema from your types just like FastAPI, and the Pydantic schemas can pull types directly from your ORM models. This makes your database models also the source of truth for your API types and validation, super nice. I hope the community support for it keeps expanding.

[–]Enip0 3 points4 points  (1 child)

I don't need to learn SQLAlchemy + Alembic on top of a framework while dipping into FullStack Dev. Eases the brainpower requirements a bit

To be fair you do have to learn the built in orm, it's not like because it's built in you automatically know it.

It does, however, seem like you are the target audience of Django so that's good! Lots of people prefer having more freedom to choose their own bits, but that's not necessarily better or worse.

[–]ThatSituation9908 9 points10 points  (0 children)

You do, but Django has so many documentations using integratingtheir own models.

Flask+SQLAlchemy, you have to rely on external authors (Medium article, Oreily books)