While experimenting with integrating FastAPI with Django we stumbled upon a project called Django Ninja.

Initial impressions

Django Ninja takes the best parts of FastAPI and integrates deeply with Django. We ran it through some tests and all in all it was a very enjoyable experience.

The way it integrates with Django’s routing feels very elegant (we did find a bug, but we fixed it and our PR was promptly merged), the documentation is well-written, the ergonomics are great (much more intuitive than DRF, to a big extent thanks to Pydantic), and the community seems friendly and responsive.

On the downside we found that Ninja wasn’t using a very recent version of Pydantic, basic CRUD operations do require a bit of fiddling, and automatically creating schemas from models left some things to be desired (better integration when it comes to field configuration and validators for example).

We’re definitely going to keep an eye on the project and it is very likely that we’ll start using it in new projects.

Want to know more about how we can work together and launch a successful digital energy service?