articles/2024/django-vs-flask-vs-fastapi/ #22
Replies: 4 comments 5 replies
-
There is one important note that you forgot to mention: Usually the bottleneck of performance is at the Database level. So no matter if you use FastAPI or Django, the query performance will be the most critical point impacting the response times of your application. So a cache mechanism, some adjustment in object serialization can improve performance by a lot. So no matter if you choose one or the other, if you improve the query performance you can even have faster performance on API level on Django then on FastAPI. |
Beta Was this translation helpful? Give feedback.
-
Nice list! For me, the ORM and migrations are the best parts of Django. I would add just one more thing to the list: the smoothness of Django's upgradability. You don’t have to refactor the application just because there’s a new version, and most things just work. Regarding the admin part, I know what you mean, and that’s the reason I created the Unfold admin theme. You can take a look at it here: https://github.com/unfoldadmin/django-unfold. |
Beta Was this translation helpful? Give feedback.
-
Well said. One correction, FastAPI can make a server-rendered HTML app very well! It is based on Starlette which gives it some batteries included: Jinja templating, a function like "reverse" for URLs, sessions, cookies, minimal authentication. |
Beta Was this translation helpful? Give feedback.
-
I love both Django and Flask. (Haven't tried FastAPI). Django was my first Python web framework, and I have to admit that the selling point for me was the Admin. Since then, I have built many projects and APIs using Django. But Flask is great as well. I was drawn into Flask by the excellent writings of Miguel Grinberg, and it remains my best choice when I want to quickly transform database queries into web endpoints. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
articles/2024/django-vs-flask-vs-fastapi/
I started using Django in 2009, and fifteen years later I am still a happy user. Why do I prefer it over Flask or FastAPI?
https://www.loopwerk.io/articles/2024/django-vs-flask-vs-fastapi/
Beta Was this translation helpful? Give feedback.
All reactions