Django APIs Read time: 1 min

What should you use to build a REST API in Django?

Frank Wiles
Frank Wiles
President & Founder

Many users who are new to Django are surprised when they realize it does not have a REST API framework built into Django core.

The two libraries you want to consider are:

Answer: Django Ninja!

django-ninja is our current go to library for building REST APIs. It gives you essentially all of the benefits that are attractive about FastAPI, notably the reduced boilerplate code and the use of Pydantic for serialization. Pydantic is the biggest element here, it's easier to control your serialization and your APIs end up faster than with DRF.

django-rest-framework is still a perfectly fine choice. If you use it currently, it's probably best to stay with it.

If you're starting a new project or your project could benefit from faster API endpoints use django-ninja.

Was this answer helpful?