django-rest-framework VS fastapi

Compare django-rest-framework vs fastapi and see what are their differences.

Our great sponsors
  • Zigi - Delete the most useless function ever: context switching.
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Scout APM - Truly a developer’s best friend
  • Sonar - Write Clean Python Code. Always.
django-rest-framework fastapi
160 355
24,521 51,708
1.4% -
8.5 9.7
4 days ago 6 days ago
Python Python
BSD 3-clause "New" or "Revised" License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

django-rest-framework

Posts with mentions or reviews of django-rest-framework. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-25.
  • Hide mysql connection from app users
    2 projects | reddit.com/r/learnpython | 25 Nov 2022
  • Why Domain Driven Design?
    2 projects | news.ycombinator.com | 25 Nov 2022
    > Sure you can do DDD in Django. But I do not find that framework inherently CQRS of SOA (not SOA due to it's monolithic nature).

    Django has "apps", which--while they do run in the same process--aren't intended to use code from each other. They're supposed to have their own models/views/templates/migrations/etc. They're effectively different services, as long as you don't think a service has to be available at a different network address to be a different service (think of mounting different apps or microservices behind different URLs, for example).

    Also, I wouldn't say Django is CQRS--CQRS is more or less a different phrasing of "JSON-RPC", which "REST" has become.

    > Last Django app i saw sure had a lot of this boilerplate going. I saw this talk and thought: well this is finally a "framework" that allowes me to do away with serialization (as in: in this framework the amount of extra work you do for making the app an SPA is fairly minimal):

    Eh, some people are highly allergic to any boilerplate, but like, the DRF example [0] has practically none.

    That Elm video is interesting, but I'm skeptical of anything whose central claim is "I can easily turn front end data requests into SQL and back again in very few lines of code". There's just a lot of inherent complexity there, and my evidence is every mainstream ORM, plus all the "backend-as-a-service" products that are multi-1000s LOC. Then again I think SQL is a great (legendary, honestly) language and we should stop trying to replace it.

    [0]: https://www.django-rest-framework.org/#example

  • recommendations for Back End Engineer roadmap?
    2 projects | reddit.com/r/learnprogramming | 11 Nov 2022
  • What are some libraries/crates that Rust still doesn't have readily available?
    2 projects | reddit.com/r/rust | 2 Nov 2022
    +1 for Django. What I'd like to see even more is something that is on-par with Django Rest Framework. This library deals with so much that I had wished that existed in other frameworks in other languages. Viewsets, different parsers, auto-generated API docs, excellent validation guards, authentication and permissions, throttling, filtering, pagination, versioning, many many more, it's just an amazing piece of work.
  • Build Blazing Fast REST Api using Django + Elasticsearch + Haystack
    4 projects | dev.to | 22 Oct 2022
    Django REST Framework
  • De/Serializing JSON In Python, While Keeping Your Types
    3 projects | reddit.com/r/Python | 10 Oct 2022
    have you seen Django REST? https://www.django-rest-framework.org
  • Any alternative to Laravel (PHP) for rapid development?
    4 projects | reddit.com/r/PinoyProgrammer | 26 Sep 2022
    DRF
  • Having issues implementing DjangoModelPermissions on DRF
    4 projects | reddit.com/r/django | 19 Sep 2022
    As you can see, GET return an empty list, later it's used to return a boolean to see if the user has permissions ( you can try to play with the codeCustomDjangoModelPermission only add the proper elt for GET (with a deepcopy to avoid modifying the original DjangoModelPermissions). This modification will return false when django will check if an authenticated user without the view permissions can see the instances of the Tool model.
    4 projects | reddit.com/r/django | 19 Sep 2022
    Interesting, it looks like there is a pull request to fix this, but not merged yet.
    4 projects | reddit.com/r/django | 19 Sep 2022
    Ok, first all thank you for the perfect presentation of your issue and the opportunity to learn something new. After looking at the source code of DjangoModelPermissions, it looks like it's working as expected. An authenticated user has by default GET permissions with DjangoModelPermissions. It's surprising and I think the documentation could be clearer, but it does specify :

fastapi

Posts with mentions or reviews of fastapi. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-25.

What are some alternatives?

When comparing django-rest-framework and fastapi you can also consider the following projects:

AIOHTTP - Asynchronous HTTP client/server framework for asyncio and Python

Tornado - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

HS-Sanic - Async Python 3.6+ web server/framework | Build fast. Run fast. [Moved to: https://github.com/sanic-org/sanic]

django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Flask - The Python micro framework for building web applications.

Django - The Web framework for perfectionists with deadlines.

swagger-ui - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

vibora - Fast, asynchronous and elegant Python web framework.

BentoML - Unified Model Serving Framework 🍱

flask-restx - Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask

starlette - The little ASGI framework that shines. 🌟