Fast Development
Django Ninja allows for rapid development of REST APIs due to its declarative syntax and automatic generation of OpenAPI documentation.
Type Safety
It supports Python type hinting which provides type safety and better integration with modern Python development practices.
Auto Validation
With built-in support for Pydantic, input data is automatically validated which ensures data integrity and reduces boilerplate code.
Integration with Django
It integrates seamlessly with Django, allowing developers to leverage existing models, views, and authentication mechanisms.
Lightweight
Django Ninja is lightweight and designed to add minimal overhead to Django applications, thus improving performance.
> The only place I really see Django at large companies is as an api using DRF or something. This is not a bad thing. Using Django as an API backend is amazingly fast in terms of development time, especially with modern frameworks such as django-ninja [1]. Just use the built-in ORM to create models, write your endpoints, and use the built-in admin interface to play with the database if you don't have endpoints for... - Source: Hacker News / over 1 year ago
Personally, I also prefer django-ninja to DRF. Source: almost 2 years ago
Or just use django-ninja if you are writing an API. Maybe it's just because I came from teams that used tornado and then fastapi but it seems like everything in this article would be solved by using a simpler interface for writing endpoints. https://django-ninja.rest-framework.com/. - Source: Hacker News / almost 2 years ago
Also recommend Django-Ninja. It basically reimplements fastapi's type and decorator-based API construction, but embedded directly in django so you have access to django's ORM and middleware library. Source: about 2 years ago
A good compromise I have found is to use Django Ninja [1]. It is inspired by FastAPI, so it has a lot of the nice things like the automatically generated Swagger/OpenAPI docs, as well as having routers as decorators, and using python types for automatic serialization. While I think FastAPI is great in its first class async support, Django has the Django ORM, plus Django Admin, which for me have been indisposable.... - Source: Hacker News / about 2 years ago
I honestly just followed the tutorial on https://django-ninja.rest-framework.com/ because I read about it and wanted to test it out / learn something new. Source: about 2 years ago
I find https://django-ninja.rest-framework.com/ even more awesome these days because it natively integrates with Django ORM, which I prefer over alternatives such as SQLAlchemy. - Source: Hacker News / about 2 years ago
Django is nice, and python's type hints can be nice. Why not have a nice django? >I really just want to write business logic, wire that up to endpoints in a nice DSL, and move on. Not really sure what you mean, but django ninja? https://django-ninja.rest-framework.com/ Just write a function, use type hints to say what arguments it takes, and throw a decorator onto it. Very similar to fastApi but with the django... - Source: Hacker News / about 2 years ago
If you've used FastAPI before, you should check out django-ninja for your views and just familiarize yourself with the Django ORM to do database operations (e.g. https://docs.djangoproject.com/en/4.1/topics/db/queries/). That'll probably get you 80% of what you need. Source: over 2 years ago
By "merger" I'm assuming you're referring to Django Ninja https://django-ninja.rest-framework.com/? Source: over 2 years ago
Nowadays, Django has an amazing library which is a lot like FastAPI but in the Django ecosystem. https://django-ninja.rest-framework.com/ It's absolutely wonderful. I would use that in a MVP, and do the F/E in NextJS + Typescript. - Source: Hacker News / over 2 years ago
Personally, I now prefer django-ninja for my APIs. I think it's structured better, faster to get started with and more comprehensible than DRF. Source: over 2 years ago
While I think it's a bad idea, I wonder if you could add Django Ninja and that would be good enough. Source: over 2 years ago
With data and business logic already structured for django, "add FastAPI to the mix" is not the best way to get those benefits, IMO. I'd be better off integrating Django Ninja. It is heavily inspired by FastAPI and carries many of the benefits I'd be looking for. But it lets me reuse the things I've already got. Source: over 2 years ago
As long-time (and happy) DRF user of more than 7 years I've recently switched to django-ninja [1]. It's like FastAPI, but for django. Granted, I've only used it for a couple of months now, and also not in production yet. But I think it's pretty nice and a breadth of fresh air for django. The thing you get from using it is full typing and IDE support (autocomplete!). It's using pydantic instead of DRF's... - Source: Hacker News / over 2 years ago
Last but not least: Django ninja. It’s basically Django's answer to FastAPI. Unfortunately the least performant option, but with the benefit of being built in top of Django. If you’re building an API, need to go to production fast and performance isn’t that important (note though that Django is still fast enough for most applications, it won’t be your limiting factor usually) this would be the best choice in my... Source: over 2 years ago
I like NextJS for the frontend and django-ninja for the backend. django-ninja has all those things you mention and way more, and has a very rich backend ecosystem thanks to being in the django world. https://django-ninja.rest-framework.com/. - Source: Hacker News / over 2 years ago
If you are using other django features but don't need the ORM, that seems like just the thing django-ninja is made for. Source: almost 3 years ago
So I have 2 Django apps: the API app and the Web app. The API app will use Django Ninja or Fast API to build a clean self-documented REST API. The Web app will serve HTMx pages. Source: almost 3 years ago
I've used a variety of Python frameworks, DJango, FLask, FastAPI, and I'm always coming back to DJango and wishing I had just used it from the beginning. Django Ninja brings some of the nice features of FastAPI to Django- https://django-ninja.rest-framework.com/. - Source: Hacker News / almost 3 years ago
I quite like the look of Django-Ninja (https://django-ninja.rest-framework.com). It's inspired by FastAPI but plays nicely with Django. - Source: Hacker News / almost 3 years ago
Do you know an article comparing Django Ninja to other products?
Suggest a link to a post with product alternatives.
This is an informative page about Django Ninja. You can review and discuss the product here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.