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

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

Patrick Loeber

3 года назад

863,238 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@gopfertami
@gopfertami - 12.10.2023 11:15

Python (or any other scripting language) is not suitable for production :).

Ответить
@muhammadagiwardhana5251
@muhammadagiwardhana5251 - 14.10.2023 10:23

great comparison through framework

Ответить
@learn_through_building
@learn_through_building - 23.10.2023 08:40

Iam a big fan to django

Ответить
@szabolcsjobbagy30
@szabolcsjobbagy30 - 28.10.2023 22:13

I have looked at several backend languages + frameworks,
and I found the Python + FLASK is the easiest, simplest one of all:

- The easiest to learn
- The most simple, readable code
- NO curly braces needed in the .py program files (and only a few needed in the html templates where you add variables sent from the .py file)

So it's amazing, I am happy I found Flask, it's a joy to code with it!

Ответить
@masterofIich
@masterofIich - 14.11.2023 02:22

Why Fortune 500 companies use Django? I doubt they using it for the Front End which kind of kills the point of Django kinda?🤔

Ответить
@knkn5049
@knkn5049 - 25.11.2023 20:01

I m poor student without cool computer, i learn python in google colab, would i be able to recreate this examples in google colab?
I already know i would have to write !pip instead of pip... Something else?

Ответить
@maithriashokan
@maithriashokan - 01.12.2023 10:52

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!

Ответить
@kralbalkizar
@kralbalkizar - 05.12.2023 17:12

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.

Ответить
@clashgamers4072
@clashgamers4072 - 13.12.2023 20:34

I was hoping for a load test at end :(

Ответить
@victormendoza3295
@victormendoza3295 - 07.01.2024 08:21

Tried it out and had an issue with the db.create_tables() in flask, but got fastapi to work. I could have went back to test flask but been jumping back and forth now going back to svelte and terraform.

Ответить
@joshbedo8291
@joshbedo8291 - 09.01.2024 15:41

Love the video thanks!

Ответить
@jaimel8219
@jaimel8219 - 14.01.2024 20:14

Django ORM was a pain. Suboptimal queries are generated unless one learn a brand new syntax on top of SQL.

Using a query builder with SQL is unbeatable.

Also the lazy loading - by default - is a PITA on legacy projects poorly designed.

Kids, don’t do Django. If you understand what you are building, ain’t no way you will let your fate getting decided by a framework hiding N+1 queries to you.

Ответить
@TheAbhimait
@TheAbhimait - 28.01.2024 01:16

Hey i use Pyodbc and write raw sql queries in flask. I am able to do everything. I want to know is there any major benefits of using ORM?

Ответить
@dr.shreyas123
@dr.shreyas123 - 30.01.2024 17:52

I am used to Django. Keen to know about fastapi. But wondering whether fastapi is secure enough like django? Django protects against CSRF, and many kind of threats, does fastapi the same way?

Ответить
@michaelmarkoulides7068
@michaelmarkoulides7068 - 06.02.2024 14:43

Very helpful video saved me a ton of time thank you . I’ve used fast api for purely api and backend in the past I love it , I have never had to develop anything with a frontend or view or using any jinja templates so this was very useful .

My favourite is fast api , I built a websockets framework with tornado in the past , I love tornado it’s solid when it comes to websockets and async aswell so but at the time fast api didn’t exist , django was too cumbersome for my needs at the time and flask was too light weight . I had redeveloped a small api with fast api and it’s definitely my first port of call for a web framework in python the autodoc feature the auto reload the pydantic built in so easy validation makes it a pleasurable experience once you get over the learning curve which is not so bad cos the documentation is really good and the speed for a python framework is really fast in production . Overall a pleasurable development experience

Ответить
@SarateanuDima
@SarateanuDima - 08.02.2024 23:23

As Java Senior for sure I would like to know about Fastapi. But still it's not so good structured as spring boot web. But I like it.)))

Ответить
@christianm4906
@christianm4906 - 10.02.2024 04:17

As someone coming from other programming languages, I find FastApi the most attractive option.

Ответить
@krishnakumardubey5069
@krishnakumardubey5069 - 16.02.2024 21:19

Flask is better

Ответить
@happyhome2523
@happyhome2523 - 01.03.2024 12:28

thank you very much!

Ответить
@LeviElekes
@LeviElekes - 03.03.2024 23:48

Thanks

Ответить
@pplot-dev
@pplot-dev - 09.03.2024 04:12

django is hard code .... flask best option

Ответить
@mariuszzawierucha1310
@mariuszzawierucha1310 - 18.03.2024 02:36

Thank you! That's a comparison which I was looking for! Summarising : Flask - easy & nice to develope, low entrance level. FastAPI - great performance, with a little more code we are able to handle 2-3x more requests. Django - the hardest to learn, not that obiviouse, but comes with great features if you dive into. Last one prefered by compannies which use python. So for home & hobby project (flask or fastapi), or for people concetrated on python job dev position - Django is right way. BTW Parick -which one of these is your favourite one?

Ответить
@hipertracker
@hipertracker - 19.03.2024 23:48

For REST in Django use Django REST Framework and all CRUD operation can be defined in a single simple ViewSet class. Plus every CRUD can be paginated, filtered with a simple one more code line.

Ответить
@bimmerapologist
@bimmerapologist - 30.03.2024 09:18

Django creates a good separation of concerns

Ответить
@serhii-666
@serhii-666 - 13.04.2024 11:49

Man why you're doing UPDATE and DELETE requests with GET?

Ответить
@Yarkanlaki
@Yarkanlaki - 22.04.2024 11:54

Flast 2m , FastAPI 5m. and Django 10m

Ответить
@xzex2609
@xzex2609 - 10.06.2024 13:20

Awesome useful video , in the end I think that the Django is the best option , and it was cleaner and very powerful one. but those other two were good.

Ответить
@NeonCodeQueen
@NeonCodeQueen - 25.06.2024 00:48

I really want to use fastAPI with Django hehe

Ответить
@johnmahugu
@johnmahugu - 25.06.2024 23:03

thank you

Ответить
@krfloll
@krfloll - 15.07.2024 17:19

Django for production, fastapi for internal tooling

Ответить
@johnmahugu3527
@johnmahugu3527 - 19.07.2024 05:10

Sehr Gut Patrick, Danke Schon hehehehe i really enjoyed this, now i can use it to introduce the concepts to my students. great work.

Ответить
@fernandostahelin2972
@fernandostahelin2972 - 26.07.2024 02:08

Great comparasion!

Ответить
@zoozalp
@zoozalp - 29.07.2024 03:45

Great video! All the info needed in just 16 minutes.

Ответить
@tukurhamid
@tukurhamid - 29.07.2024 10:26

Thank you bro, this is helpful

Ответить
@d.TheFrreman
@d.TheFrreman - 25.08.2024 21:15

Thank you so much for the great video! The direct comparison shows a lot of the specific possibilities. 👍👍👍

Ответить
@GaborKalucza
@GaborKalucza - 13.09.2024 18:22

Hey, what theme are you using? Thanks!

Ответить
@edwinquaihoi8503
@edwinquaihoi8503 - 18.09.2024 03:36

I think the intent of FastAPI is to use it with a SPA framework (Angular, React, Vue etc) rather than serving HTML

Ответить
@maxpreobrazhensky7124
@maxpreobrazhensky7124 - 04.10.2024 20:07

IMO, Django is easily the worst Python framework. It's bloated and tightly-coupled. To start developing APIs you have to install a bunch of requirements (including DRF), because it isn't made for APIs-development out of the box. At the same time, out of the box, Django is full of tightly-couple stuff that you may never need in your project (Django Admin, etc). I also think that Django's ORM is much worse than SQLAlchemy, which can be used on its own and with other frameworks, while Django ORM is tightly-coupled with Django. Also, originally, its ORM was as far away from SQL as it could've been. Meaning, engineers, highly-proficient in SQL, had to learn it as a some sort of a second language, because their SQL knowledge wasn't applicable to Django ORM.

Ответить
@k98killer
@k98killer - 10.11.2024 21:35

Regarding Django, the way I feel about it is a 10 Guy meme: How complex do you want this project to be? Yes.

Ответить
@HankOrionYT
@HankOrionYT - 13.11.2024 18:45

what combination do you think is best to learn for newbie?

Ответить
@LouisP1-e8z
@LouisP1-e8z - 28.11.2024 00:38

Another framework is Streamlit which is very cool to create small apps (e.g for AI). But the one I really love (as many people) is Django.

Ответить
@rishiyogil.n.7222
@rishiyogil.n.7222 - 06.12.2024 04:25

1000 thanks to you, Iam a Cloud Arichtect wanted to choose one py framework to learn and was confused, you cleared everything, I decided to go with flask, thanks man

Ответить
@likithraj855
@likithraj855 - 09.12.2024 15:24

Why are we creating a venv file? Aren't we already running the files inside a python interpreter within an environment? Also, my python environment which I created is in a different location, and the location for the folder scripts are in a different folder. How to run the export variables in this case if my flask library is installed in main interpreter location of the environment and not on script location? Current I am facing this error: export: The term 'export' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Ответить
@lordew9476
@lordew9476 - 09.12.2024 19:16

I think flask is better.

Ответить
@EdwardTilley
@EdwardTilley - 31.12.2024 07:32

Great overview and Tutorial Patrick. Much obliged/ Thank You.
I have used Flask extensively and fall back to Django (for front-end systems) because I was tired of adding modules for language, blueprints, etc. as the application grew in size and features. It will be interesting to see if FlaskAPI adds all of the bells and whistles with good documentation. The Django Admin doesn't benefit us devs much I don't think, but the FastAPI debug screen that you mentioned looks perfect for getting all of the finishing touches right. That is very helpful.

Ответить
@SpicyChais
@SpicyChais - 04.02.2025 03:56

what vscode theme is that?

Ответить
@heatherhutchinson3625
@heatherhutchinson3625 - 20.02.2025 05:27

When everyone uses AI to make videos nobody will take the time and attention to make videos like this. 😢

Ответить