Django VS fastapi

Compare Django vs fastapi and see what are their differences.

Our great sponsors
  • Zigi - Delete the most useless function ever: context switching.
  • Scout APM - Truly a developer’s best friend
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Sonar - Write Clean Python Code. Always.
Django fastapi
380 358
67,422 51,906
1.4% -
9.9 9.7
7 days ago 4 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.


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


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-27.
  • How does Depends with SQLAlchemy session work?
    2 projects | | 27 Nov 2022
    I, too, have encountered something similar. In my opinion, abandoning this function and such a solution, for example, solves the problem.
  • Falcon vs Flask?
    4 projects | | 25 Nov 2022
    Anecdotally, FastAPI seems to be prone to weird unexplained errors like OOM. In fact, there's an issue that's been open for 2 years about an OOM issue.
    4 projects | | 25 Nov 2022 Is the issue. I saw you had fixed at uvicorn side. Thats interesting.
    4 projects | | 25 Nov 2022
    Why do you think your new system won't result in OOM errors? You can't jut say it is fastapi's fault, it seems like a complex issue
  • DApp API with FastAPI [Backend Blueprint]
    5 projects | | 22 Nov 2022
    Here are some features it includes as well as the GitHub Repository link if you would like to check it out: - [x] User registration through digital wallet - [x] User login through digital wallet - [x] User profile update - [x] User profile delete - [x] User profile get - [x] User profiles get all - [x] User profile get by digital wallet address (public key) - [x] User profile get by email - [x] JWT authentication / verification - [x] Signature (Signing) registration - [x] Custom BaseModels by pydantic - [x] JWT only admin/registered user access check - [x] get/set e-mail accounts in the database - [x] Custom pymongo database class wrapper - [x] Full logging support with built-in logging and saving the logs to custom files - [x] pymongo exception handlers - [x] Custom FastAPI middleware - [x] Function docs and parameters explanation and use cases - [x] x days (custom time) JWT token expiration checks - [x] All SECRETs are stored in the .env file for security and accessibility - [x] Ready to deploy and use on Heroku and Vercel with Procfile and requirements.txt - [ ] All endpoints and functions tests (fastapi/issues/5675)
  • Fastberry (FastAPI + Strawberry)
    2 projects | | 20 Nov 2022
  • Ask HN: What is example of good documentation in your opinion?
    2 projects | | 20 Nov 2022

    Clear and easy to follow language with awesome examples. I really like that additional concepts are explained as well.

  • Python framework to test hardware and control various equipment
    2 projects | | 15 Nov 2022
  • Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 1 – Real Python
    3 projects | | 15 Nov 2022
    And while I wouldn't say that the tutorial is in any way bad, I believe that you would need a very good reason to use Flask/Connexion over FastAPI, at least if you start a new project. The tutorial on the official FastAPI Site is very detailed as well.
  • Ask HN: Where can one learn about boring web development?
    8 projects | | 11 Nov 2022
    The Flask mega-tutorial is great - but I would recommend looking at fast Api today, rather than flask. That will in general only give you an Api though - you'd typically add on a pure js/ts front-end or something:

    Or look at Django - for something more full-featured in python.

What are some alternatives?

When comparing Django 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:]

Flask - The Python micro framework for building web applications.

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

Nest - A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) 🚀

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.

django-rest-framework - Web APIs for Django. 🎸

BentoML - Unified Model Serving Framework 🍱

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