I built the same app 3 times | Which Python Framework is best? Django vs Flask vs FastAPI

preview_player
Показать описание
I built the same app 3 times with 3 different Python web framework. Which one is best? Django vs Flask vs FastAPI.

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python

Timeline:
00:00 - Introduction
01:30 - Flask
05:05 - FastAPI
10:53 - Django

----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

I've been using Django for over 10 years, before version 1 was even released. I think one of the biggest advantages to Django is the ORM. The downside to Django is for an API most people use the Django Rest Framework, which doesn't seem as nice as FastAPI in my opinion. Another key advantage to Django is the structure and organization it provides with its concept of Apps. This is especially helpful and important for large applications. I think it would be really hard for me to switch from Django's ORM to SQLAlchemy.

epicserve
Автор

I absolutely enjoyed this video. Not only did I learn about the 3 frameworks, but was in awe of the how you edited this video. Perfection!

maithriashokan
Автор

Started Flask last year, it is currently rising up into my favourite framework, I’m enjoying my transition from PHP to Python

uju
Автор

Really great speedrun of the different web frameworks -I'm glad that you didn't give a definitive answer for which is best, only giving the pros and tradeoffs of each so a good dev can pick which one fits with their use case

DanhWasHere
Автор

Great video. Awesome how you managed to compare the three frameworks in such a short video while still being clear and concise about the pros and cons.

phipag
Автор

as someone who had experienced pain and headache due to non typed code, I am definitely going for FastAPI
Not to mention the auto OpenAPI Docs which make it easy to integrate security automation tools like OWASP ZAP. For an api project this is great.

Things like the admin panel and the front end can be built separately using Vue or something like that.

I just need an API, so FastAPI it is.

Thanks for the video. this is really helpful.

WineZ
Автор

I love flask for rapid development. Our projects never get very big because we run a microservice model. I can build out new logic for a new api feature, run the pipeline and publish the swagger file, all before lunchtime. Even moderately sized apps can be managed with blueprints fairly easily, and Flask 2+ supports nested blueprints.
SQLAlchemy and Pandas do enough for me, I don't feel the need to abstract away the DB like an ORM coerces. Rails does a lot better than Django in that aspect IMO.
Also, you should be escaping query arguments and variables used in the URI ;)

tjbredow
Автор

For microservices flask and fastAPI
For full stack django
It depends on use cases what kind of application you want to develop

adityadeshmukh
Автор

I prefer using Flask, because it gives a lot of flexibility. You can easily use it to build a similar structure to the Django app and separate stuff (yes with a bit more manual work, but possible), but it is not something obliging to make an application work. And especially for smaller projects, it gives a lot of freedom. In addition to that, latest versions of flask support async/await functions.
FastAPI seems like it is build for APIs and not fully fledged websites, so probably it is best to keep it that way.

Deadlious
Автор

Best thing about Django is that it's a fullstack framework. In a structure that needs frontend development, building backend API is easier and faster with Flask and FastAPI, but I need typing so... Going for FastAPI !

minorandrianarivo
Автор

Thanks to this video I switched from Django to FastAPI and I don't regret it one bit. Django does a lot of things that are hidden to the developer and has a very complicated structure which is overkill for simple apps. With FastAPI it actually feels like you're coding. I wish I had checked it out sooner rather than wasting my time/energy on Django.

dfkt
Автор

I regret starting with Django instead of Flask. If I knew Flask earlier then I would have better grasp of what is going on in django :)

pawlack
Автор

Big fan of Flask, but I might have to experiment with FastAPI!

jakeditslear
Автор

Super helpful video thanks!! This is exactly what I needed: a QUICK overview of these Python options, how you get up and running, how they differ. I have a spaghetti monster Django app at work and I need to make an on-the-side api service, wondering if I should just start completely fresh or try and integrate with the existing beast. Separation of concerns, ease of implementation, and developer role structure says Flask it is. 👌👌

oncedidactic
Автор

Man, it was awesome. I have started Flask for a while & this was a nice big picture for the backend roadmap.

SiaTheWizard
Автор

Very nice comparison! Even though I'm Django dev myself, I can imagine how complicated it must seem compared to Flask for instance. Maybe you should have shown an example with class based views to see even more power of Django.

Balkac
Автор

I've used flask for a long time but switched to Django for a new project at work - man, it's really a good all-around package for full stack production web apps. Love the way things are organized into apps, and all the libraries which make your life easier. Like Celery for background tasks.

jonasls
Автор

i like Flask's context management with the app factory pattern, very easy to get hold of application-wide config and db instances

kierencoetzee
Автор

I’ve recently gotten into python development and this was a video I didn’t know I needed! Thanks for your hard work!

grantbellar
Автор

What you should notice about FastAPI is that it has dependency injection built in. Try configure tests for complicated microservices without DI. Oh boy patching all the consumer/producer/external api/sdk calls will be a huge mess. Just impossible to integration test without messy mocks instead of clean DI.

ND-gntc