No video

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

  Рет қаралды 828,992

Patrick Loeber

Patrick Loeber

Күн бұрын

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:
www.python-eng...
Code: github.com/pat...
✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?u... *
⭐ Join Our Discord : / discord
📓 ML Notebooks available on Patreon:
/ patrickloeber
If you enjoyed this video, please subscribe to the channel:
▶️ : / @patloeber
Inspired by Fireship's JS framework video: • I built the same app 1...
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
🖥️ Website: www.python-eng...
🐦 Twitter - / patloeber
✉️ Newsletter - www.python-eng...
📸 Instagram - / patloeber
🦾 Discord: / discord
▶️ Subscribe: / @patloeber
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
🅿 Patreon - / patrickloeber
#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! 🙏

Пікірлер: 494
@epicserve
@epicserve 2 жыл бұрын
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.
@mke7605
@mke7605 2 жыл бұрын
Same here. I used Django since version 1.3. Did jab a bit with flash but always find myself back at django after a while.
@rustytheded
@rustytheded 2 жыл бұрын
Same, working since 1.4. DRF is not that bad, but it's much harder to learn than FastAPI. Looks uglier too and the configuration just isn't worth it, especially for smaller projects. I'm still working with DRF at my job, but personal projects are all FastAPI now. Will probably change most of the job project to FastAPI anyways.
@NishantCosmos
@NishantCosmos 2 жыл бұрын
@@komkaitkanchai8766 wow i'm amaze to see django vets here, i just learnt making basic django apps.
@rawmetal3052
@rawmetal3052 2 жыл бұрын
with Django Ninja introduced, I don't think API should be a problem anymore in Django
@mayankpant5376
@mayankpant5376 2 жыл бұрын
Why use ORM even 😂😂 just use normal SQL
@maithriashokan
@maithriashokan 8 ай бұрын
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!
@WineZ22
@WineZ22 2 жыл бұрын
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.
@uju02
@uju02 2 жыл бұрын
Started Flask last year, it is currently rising up into my favourite framework, I’m enjoying my transition from PHP to Python
@irotochukwu6313
@irotochukwu6313 2 жыл бұрын
same too, I transitioned from php to python 3 years ago. python is so much cool.
@kevinlesieutre
@kevinlesieutre 2 жыл бұрын
@@wolfmeowmeow developp in something you like, so you'll dive deeper without even noticing and you'll become way better and your time way more valuable.
@TortelliniSRL
@TortelliniSRL 2 жыл бұрын
Hey how does flask feel compared to laravel? I've been using and loving Laravel for years now but i want to try something else cuz php still feels kinda ancient, how would you compare the two? Is Laravel more similiar to Django instead? (I would only need it for backend, usually my frontend is angular/react)
@wolfmeowmeow
@wolfmeowmeow 2 жыл бұрын
@@TortelliniSRL you should stick with it, laravel is good, you just need a backend framework doesn’t mean you have to learn all of those are exists.
@TortelliniSRL
@TortelliniSRL 2 жыл бұрын
@@wolfmeowmeow i agree with you for that but learning multiple framework kinda is my job ahahaha, anyways in our company we main laravel for backend and our cto is now giving us the chance to switch to one that could potentially suit our needs better, the learning curve won't be a problem since it will most likely be a gradual change (most of our stuff still run laravel backend), i was just wondering if it was worth to switch (if the writing time efficiency / potential less package support ratio was)
@phipag1997
@phipag1997 2 жыл бұрын
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.
@DanhWasHere
@DanhWasHere 2 жыл бұрын
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
@Voidstroyer
@Voidstroyer 2 жыл бұрын
I mean, not giving a definitive answer is good and all, but an opinion at the very least would be appreciated
@davidmcken
@davidmcken Жыл бұрын
@@Voidstroyer The pros for each library showed their strengths and where they should be used. Django enforces a specific file structure and layout and comes with the python-esque "batteries included". I would hazard a guess its used in larger projects because of that structure so there is less conflict between the teams (e.g. frontend guys are primarily in the templates, backend would be between models and views). Flask is extremely light-weight and you can build something functional in an extremely small codebase (I believe he said 47 lines of code excluding the HTML template). One of Flask's major pros is you can choose what library you want for every part of the process, don't like the templating engine? Cool, pick a different one. Want to write your SQL by hand and bypass the ORM entirely, np. In that way it completely gets out of you way and allows you to choose the right tools for your use case. FastAPI seems to follow Flask's general structure but adds batteries for an extremely common use case which is RESTful APIs (while not throwing in the kitchen sink like Django) and makes use of the type-hinting in python 3 avoiding issues the other two had to contend with prior to that feature being added to python. Its relative youth would be a double-edged sword, for greenfield uses you don't have any technical debt in the form of backwards compatibility with existing code, however on the other hand how well has it been battle tested? On pypi its still listed as Beta, should I expect breaking changes in the future? If you are confident you can keep up with its development it probably would be the most performant of the three especially with all the performance enhancements coming in python 3.11 and later.
@Voidstroyer
@Voidstroyer Жыл бұрын
@@davidmcken Thank you very much for the detailed explanations of the pros/cons for each choice.
@tjbredow
@tjbredow 2 жыл бұрын
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 ;)
@Deadlious
@Deadlious 2 жыл бұрын
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.
@youssefchaabi5402
@youssefchaabi5402 2 жыл бұрын
I can programme big and fast Web projects by Flask only ?
@Deadlious
@Deadlious 2 жыл бұрын
@@youssefchaabi5402 why not?
@youssefchaabi5402
@youssefchaabi5402 2 жыл бұрын
@@Deadlious Flask good in scaling ??
@youssefchaabi5402
@youssefchaabi5402 2 жыл бұрын
@@Deadlious OK bro thank you
@kamal-hassan
@kamal-hassan Жыл бұрын
@@youssefchaabi5402 what did you go with? Flask?
@adityadeshmukh2390
@adityadeshmukh2390 2 жыл бұрын
For microservices flask and fastAPI For full stack django It depends on use cases what kind of application you want to develop
@iamlegqdev7743
@iamlegqdev7743 2 жыл бұрын
@manny I'm definitely not an expert, but I would say FastAPI given that you'll probably want to build backend microservices for your app, and then just create frontend clients (for web, android, ios, etc) that communicate with your FastAPI backend.
@d3f3kt57
@d3f3kt57 Жыл бұрын
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.
@johnnygarcia7297
@johnnygarcia7297 10 ай бұрын
I did the same, fastapi also gives you more freedom since django only lets you use its dependancies while fastapi lets you install and work with whatever, not to mention faster and more lightweight only the tools you need
@oncedidactic
@oncedidactic 2 жыл бұрын
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. 👌👌
@Balkac
@Balkac 8 ай бұрын
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.
@jakeditslear1678
@jakeditslear1678 2 жыл бұрын
Big fan of Flask, but I might have to experiment with FastAPI!
@vitalnikod7197
@vitalnikod7197 2 жыл бұрын
me too
@meizufluxx
@meizufluxx 2 жыл бұрын
fastapi has awful docs
@NishantCosmos
@NishantCosmos 2 жыл бұрын
@@meizufluxx but faster and better development if you learn it right?
@meizufluxx
@meizufluxx 2 жыл бұрын
@@NishantCosmos no fastapi is awful because the docs are awful. they desperately need an api reference
@d34dplayer
@d34dplayer 2 жыл бұрын
For any "basic" app the documentation is enough, the only times I have had to dive into the fastapi code was for more customized OAuth and even then the source code isn't that cryptic, I've been using it for over a year and it's my go to for rest APIs that don't require massive scalability. The biggest difference with flask and django is that if forces you to make a distinction between frontend and backend, ideally only making a rest api that a static frontend consumes, but I see this as a better way to build web apps as it forces you to learn about frontend frameworks that are way better than anything a python framework can provide.
@minorandrianarivo661
@minorandrianarivo661 2 жыл бұрын
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 !
@IUfidi
@IUfidi 2 жыл бұрын
Ca va, mon ami.
@oliverreviews8496
@oliverreviews8496 2 жыл бұрын
I can tell you more. In large projects nobody writes code without typing :D So you made a good choice :D
@huacai168
@huacai168 2 жыл бұрын
Django-ninja is a good choice
@wolfmeowmeow
@wolfmeowmeow 2 жыл бұрын
@@huacai168 it really doesn't matter what you use, end of the day its all about python and how you're implementing your python mechanism into web.
@raianmr2843
@raianmr2843 2 жыл бұрын
@@wolfmeowmeow tech debt is a real issue lmao
@kierencoetzee2517
@kierencoetzee2517 2 жыл бұрын
i like Flask's context management with the app factory pattern, very easy to get hold of application-wide config and db instances
@devdex.
@devdex. 2 жыл бұрын
true
@SiaTheWizard
@SiaTheWizard 2 жыл бұрын
Man, it was awesome. I have started Flask for a while & this was a nice big picture for the backend roadmap.
@pawlack
@pawlack Жыл бұрын
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 :)
@HaBhBo
@HaBhBo Жыл бұрын
true, if i would start again i would learn flask then learn django, as flask helps you understands how django does things under the hood.
@creed404
@creed404 Жыл бұрын
Yup flask is a gem
@tejas4054
@tejas4054 Жыл бұрын
Flask is complicated because of code written in one file,,, there is no MVT structure which is easy to wrte codes in different files
@tejas4054
@tejas4054 Жыл бұрын
Django is super easy that the most complecated fastapi and flask
@miguelfrosales01
@miguelfrosales01 9 ай бұрын
Once you work long enough using Django you end up knowing what is going on inside. What you find in django is a very well developped structure. I personally dont care if fastapi is faster, because I can just scale horizontally my django service. microservice. In the long run the bottleneck is 99% of the time the database. Whe programming you want a mvp asap you don't get to waste time trying to integrate stuff, you just want something that works well fast, that's why I'll stick with Django. That being said I it is not very good when it comes to handling websockets, I'll usually go with node
@jonasls
@jonasls 2 жыл бұрын
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.
@josedominguez8782
@josedominguez8782 Жыл бұрын
Celery is an standalone tool. You can use it with Flask, FastAPI and any other framework.
@dipenketanbhaidave154
@dipenketanbhaidave154 Жыл бұрын
Brother can you suggest best project in flask , for Intern resume.
@jonasls
@jonasls Жыл бұрын
@@josedominguez8782 True, but I was thinking about celerys direct integration to django - "django-celery".
@jonasls
@jonasls Жыл бұрын
@@dipenketanbhaidave154 Issue tracking system
@iamqaasim
@iamqaasim Жыл бұрын
This is just the video I needed 👌 I can't belive you managed to do this is under 20min 😅 well done 🙏
@patloeber
@patloeber Жыл бұрын
thank you!
@GurashishSingh1
@GurashishSingh1 2 жыл бұрын
Love this!! That FastAPI docs generation is super neat!
@josesebastiancolaneri7125
@josesebastiancolaneri7125 2 жыл бұрын
I use django in backend and react js in frontend.. For me its really awesome the organization and structure you get with django. I also used django-rest-framework, and for API apps drf is the best choice in my opinion.
@jonathanidioseph5101
@jonathanidioseph5101 2 жыл бұрын
How do u merge the two together?
@asii_k
@asii_k 2 жыл бұрын
@@jonathanidioseph5101 not the original commenter but we do the same where I work. Front end services just either make HTTP calls to the backend and/or can listen to or send RabbitMQ (sometimes pub/sub) messages. They're all microservices so each component is it's own discreet unit that just pass data between themselves
@waititsnilson
@waititsnilson 2 жыл бұрын
@@jonathanidioseph5101 you merge front and backend through rest api, where the frontend makes requests to the backend
@gh0stb0y98
@gh0stb0y98 Жыл бұрын
​@@asii_kresourses to learn microservices with django-react ?
@grantbellar3267
@grantbellar3267 Жыл бұрын
I’ve recently gotten into python development and this was a video I didn’t know I needed! Thanks for your hard work!
@JohnnySins-zf4fb
@JohnnySins-zf4fb Жыл бұрын
Coming from FLASK to Django it is so much easier in Django when it comes to scalability for further upgrade than Flask
@talanky
@talanky 2 жыл бұрын
Great editing on this! It was the perfect speed for me instead of watching a 2hr code along
@michaelmarkoulides7068
@michaelmarkoulides7068 6 ай бұрын
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
@Semmelein
@Semmelein 2 жыл бұрын
Using Django since 0.96 or so and I just love it because of all the batteries included.
@zoozalp
@zoozalp 17 күн бұрын
Great video! All the info needed in just 16 minutes.
@cedric1731
@cedric1731 2 жыл бұрын
Flask-restx features Automatic Swagger creation as well :)
@balloney2175
@balloney2175 Жыл бұрын
Awesome! but not for beginners. This is how programming should be taught, I believe. Straight to the point and not long video.
@wackytheshaggy
@wackytheshaggy Жыл бұрын
Great overview . My more opinionated take: Fastapi for simple APIs and micro services, django for anything more complicated. As soon as you have a db, you’ll want an admin app. Any large app in flask ends in the desire to have used django. And btw, with a class based view the django code could have been even simpler. And things like caching and django_q for queues bring the speed in complex apps.
@davidmcken
@davidmcken Жыл бұрын
Agree fully, the batteries Django includes are hard-won battle scars from those that went before you. There is usually very little benefit in re-inventing the wheel, focus on whats unique to your app. For smaller projects you should be designing to avoid those issues in the first place.
@nagibgonzalez5645
@nagibgonzalez5645 Жыл бұрын
Thank you for this. I have mostly been using python for data science but I'm looking to start building out web apps.
@marcelmoraisluna
@marcelmoraisluna Жыл бұрын
Great man. I don't work with Python, but the simplicity is just great.
@user-un6vi8ix3q
@user-un6vi8ix3q Жыл бұрын
Django's syntax seems cleaner and more readable than others
@BrianStDenis-pj1tq
@BrianStDenis-pj1tq Жыл бұрын
I struggle with the idea of microservice versus framework. In our company, we aim to build microservices. A microservice is either a visualization layer or maybe business logic or maybe an entity store service. The first example (Flask) had all of those combined.
@Ehsan-the
@Ehsan-the Жыл бұрын
Flask is so cool for small and medium size projects and can increase your speed in so many ways, i dont have any experience with fastapi but it looks the same.
@ND-gn8tc
@ND-gn8tc 2 жыл бұрын
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.
@MoneylessWorld
@MoneylessWorld 2 жыл бұрын
@Francisco Mendoza Torres yes
@ND-gn8tc
@ND-gn8tc 2 жыл бұрын
@Francisco Mendoza Torres yes it is a killer feature
@subipan4593
@subipan4593 Жыл бұрын
Why do you need DI in Python? As far as my understanding, DI is just bundling different modules/components together at RUNTIME. In static languages like Java and C# you'd need DI. In Python, you can assign any variable to any object at runtime. I would like to know why you'd need it in Python? Python has DI built-in isn't it?
@ND-gn8tc
@ND-gn8tc Жыл бұрын
@@subipan4593 makes it easy to setup tests and test, thus, you can achieve extremely high coverage
@subipan4593
@subipan4593 Жыл бұрын
@@ND-gn8tc ONLY when you're using static languages like Java. Python is dynamic language that can change data types in RUNTIME. No need for DI in python.
@wilhelmngoma9009
@wilhelmngoma9009 10 ай бұрын
Great content. Thanks Patrick. This was my first experience of Flask and FastAPI. So far Flask and Django are my favorite. I'm experience all of them more
@Gabrielowns321
@Gabrielowns321 Жыл бұрын
Managed to create a pretty cool app with a massive database using Flask in 6 weeks, its great.
@mohammedalbatati5529
@mohammedalbatati5529 2 жыл бұрын
Many thanks that’s a lot of work well done. I started couple of years ago with Django and found my self stuck with it 😅 Maybe I need to explore more specially the fact API looks interesting
@architkapoor2503
@architkapoor2503 2 жыл бұрын
It's called FAST API.
@SarateanuDima
@SarateanuDima 6 ай бұрын
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.)))
@bogdanf6698
@bogdanf6698 2 жыл бұрын
I really enjoy the constancy of your voice and the equidistance when presenting the 3 frameworks
@comedyclub333
@comedyclub333 2 жыл бұрын
As a mostly-flask-user I've been using bottle for the last few months. Man, this framework really blew my mind. While the basics are nothing special, advanced in-depth knowledge really makes it one of the most powerful (as in flexiblility and performance) frameworks in my opinion.
@sovietwarmachine1979
@sovietwarmachine1979 2 жыл бұрын
You could say you've been "hitting the bottle" for the last few months! *badumtsss* (I'll see myself out now...)
@youssefchaabi5402
@youssefchaabi5402 2 жыл бұрын
I can programme big and fast Web projects by Flask only ?
@mikesturyan9
@mikesturyan9 2 жыл бұрын
I use fastapi for my api' and starlette for web apps. Fastapi is built over starlette, so there is little paradigm shifting. I don't personally like Django as it sets too many rules. I would just build a vuejs front end instead of Django, then an api layer with fastapi.
@BehruzbekOtayev
@BehruzbekOtayev 2 жыл бұрын
"vuejs front end instead of Django"? Really? How are Django and VueJS comparable?
@johnniefujita
@johnniefujita 2 жыл бұрын
@@BehruzbekOtayev i think he meant that he is not using the front end template engine provided by django out of the box. Using django just to build the api. Which is actually norm in production for quite sometime already.
@yasayah7289
@yasayah7289 2 жыл бұрын
I would love a fastapi + vuejs tutorial!
@yoannguillard6877
@yoannguillard6877 2 жыл бұрын
@@yasayah7289 take it separately, "vuejs tuto rest API" and "fastAPI tuto". The only glue is to serve your static files generated by vuejs.
@herantd
@herantd 2 жыл бұрын
Vuejs and flask is match from heaven as well
@MagnusAnand
@MagnusAnand 2 жыл бұрын
All of them are good, but I like the Django style
@christianm4906
@christianm4906 6 ай бұрын
As someone coming from other programming languages, I find FastApi the most attractive option.
@VanguardOnline2011
@VanguardOnline2011 Жыл бұрын
Thanks for the detailed code comparison Patrick, especially with the in-depth code comparison. That was a lot of work. Much appreciated. Thanks. I also looked at your channel. Lots of useful tutorials. Thanks. Subscribed.
@hipertracker
@hipertracker 4 ай бұрын
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.
@Gglsucksbigballz
@Gglsucksbigballz Жыл бұрын
Super impressive video! Covered a lot of info concisely - must have taken a lot of time! FastAPI seems to pique my interest for a micro-service based app. Also seems to get a lot done without a huge learning curve. I’ve worked with Django and it’s awesome! if you know your way around.
@ekaetteessien4932
@ekaetteessien4932 Жыл бұрын
Love this video! I use the FastAPI framework and it's absolutely amazing. I'm working on learning Django now but it was useful to learn the differences between the frameworks.
@johnmahugu3527
@johnmahugu3527 27 күн бұрын
Sehr Gut Patrick, Danke Schon hehehehe i really enjoyed this, now i can use it to introduce the concepts to my students. great work.
@christianpenguin2651
@christianpenguin2651 Жыл бұрын
For sure, this video was a lot of work, thanks for it! Now I'm once again on the verge of deciding between an older well-tested Framework (Django) and a cool newcomer (FastAPI)... nerd problems...
@mke7605
@mke7605 2 жыл бұрын
Have been using Django since version 1.3. Also used flash for some minor service. But fast api looks very interesting.
@cupajoesir
@cupajoesir 2 жыл бұрын
If I had more time I'd write a shorter letter. Thank you for a short and concise video. Very well done!
@warloccarlos8522
@warloccarlos8522 Жыл бұрын
I have experienced Flask and Django both. Nice comparison. I liked Flask, as you mentioned, it is quick for beginner and also we can run custom scripts easily with flask to display output on web.(I know we can do the same with FastAPI and Django as well 😄)
@ragsdale9
@ragsdale9 Жыл бұрын
This was a fun little exercise in the different frameworks. I think I must be using a different version of python or something because using flask exactly like you wrote it seems to give me an error regarding using it outside of the app context. Which can be fixed with a few lines of code appropriately placed, if you understand where and why. For the rest of them this is what I wanted to see coming here (although the post/get/put/delete not being fully hashed out did kind of bother me).
@nagibgonzalez5645
@nagibgonzalez5645 Жыл бұрын
@ragsdale9 can you provide the few lines of code for the fllask example. Im getting the same error
@nagibgonzalez5645
@nagibgonzalez5645 Жыл бұрын
hey I was able to find the solution on github haha!
@CesconetoG
@CesconetoG 2 жыл бұрын
Iv been trying to puzzle out what he says @ 6:26 for more than 10 minutes but finally figured it out: type hints, not type in, nor tie pins (as the auto generated captions believes he means)
@abinmichael3661
@abinmichael3661 2 жыл бұрын
FastApi is best one for API development my experience Thank you
@facundogoiriz7323
@facundogoiriz7323 2 жыл бұрын
It is Flask for me, i love the simple and intuitive way of handling things with Flask, its the most Pythonic of the 3 and also the most functional, and i love working in a functional way.
@robin888official
@robin888official 2 жыл бұрын
Do you mean functional in a paradigmatic or in an efficiency way?
@facundogoiriz7323
@facundogoiriz7323 2 жыл бұрын
@@robin888official in a paradigmatic way
@majkelpl8611
@majkelpl8611 2 жыл бұрын
@@facundogoiriz7323 Can you give any examples? I moved from a functional language to Python and the whole language is by no means functional. Still, Pythonic way of writing most things fullfills my need for "clearness" and conciseness. I am using Flask too and I think it's very neat.
@xzex2609
@xzex2609 2 ай бұрын
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.
@TheAbhimait
@TheAbhimait 6 ай бұрын
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?
@ijazali8618
@ijazali8618 10 ай бұрын
I have completed 3 projects in Django now interested in API, but confused a little bit what now I choose DRF or FastAPI. I read on web that FastAPI is easy and fast but Django REST API is secured. Which I now choose become a conflict for me, now need guide from seniors Django developers with their experience in this regard.
@manusharma8777
@manusharma8777 Жыл бұрын
A very clear comparison indeed. Thanks.
@mariuszzawierucha1310
@mariuszzawierucha1310 5 ай бұрын
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?
@oseitutu598
@oseitutu598 Жыл бұрын
Amazing Video, Much appreciated. I learned a lot from this. Subscribed ❤
@JalalMujawar
@JalalMujawar 8 ай бұрын
For those who are getting error for the flask code, at 2:37 replace line 18 with app.app_context(): # Creating the database tables db.create_all()
@DevlogBill
@DevlogBill Жыл бұрын
I've only used Django for only 4 months, and I love the framework. Just out of curiosity have you tried creating a frontend project like Angular or React or maybe mobile like a flutter or React native with one of these backend technologies? Is Django easier when used for making a GET request for a frontend technology? Or would you recommend one of the other backend technologies like FastAPI or Flask instead? Not sure yet but I am thinking about focusing on Django with React or maybe Angular for Full Stack, any thoughts? thanks Patrick...
@BuddyWazzup
@BuddyWazzup 2 жыл бұрын
well... the three of them are obviously really good. That's totally a matter of personal choice.
@professor-dad
@professor-dad Жыл бұрын
Great presentation! Thanks for all the time you put into it. 👍🏼
@nathanwebb2800
@nathanwebb2800 2 жыл бұрын
I use flask & gunicorn in docker containers but FastAPI's self documenting seems kinda handy....
@shafaitahir4728
@shafaitahir4728 Жыл бұрын
Thank you for this video, it helped me get an idea of what to start (i didnt understand anything 😅😅) but it gave me an idea as what to expect from each one. A hard decision to make of which one to begin with. any suggestions or roadmap are welcome, Thanks.
@alisonhj
@alisonhj 2 жыл бұрын
I got to know FastAPI with this video and it looks great! Also great job with your video!
@fernandostahelin2972
@fernandostahelin2972 20 күн бұрын
Great comparasion!
@krissn8111
@krissn8111 2 жыл бұрын
I prefer Flask but the FastAPI automatic API documentation is really cool.
@johnniefujita
@johnniefujita 2 жыл бұрын
async support is incredible too
@PythonDevelopment
@PythonDevelopment 2 жыл бұрын
Great content, dude! Awesome!
@astronemir
@astronemir 2 жыл бұрын
Man every time I want to Build an API with Django I get so bogged down with Django specific stuff. Maybe I’ll try fast API. Looks much faster. Flask is too basic and I don’t want to bother learning a flask framework :P
@astronemir
@astronemir 2 жыл бұрын
1 month later, it's really great. Wow.
@usamahussain4461
@usamahussain4461 Жыл бұрын
I love Django the most, did not like Flask that much. HOwever, FastAPI does seem extremely interesting, not to mention its speed and performance as its directly built on top of ASGI specification!
@timmehtimmeh576
@timmehtimmeh576 10 ай бұрын
Thanks for the detailed walktthrough. I was hoping to get an overall judgement or review of each. What is your answer to the "which is best?" question?
@aariskazi9002
@aariskazi9002 2 жыл бұрын
Thank you so much for showing fast API database system I was stuck very long time thanks a lot for the video
@Hubert4515
@Hubert4515 2 жыл бұрын
i used to do all my work in Flask but recently i switched to FastAPI and i like it a lot
@anandraj2895
@anandraj2895 Жыл бұрын
I recommend django . Because it has better orm query lookups , clean architecture , easy to maintain , performance and optimization.
@SweaterGuyUK
@SweaterGuyUK 2 жыл бұрын
I’m not sure if anyone else has mentioned this (sorry if it’s a duplicate), but in your vs code terminal you should be using a power line patched font. That’s why you have black squares before your prompt.
@davidarbanas6056
@davidarbanas6056 2 жыл бұрын
Congrats on hitting 100K!
@Kennethlumor
@Kennethlumor 2 жыл бұрын
Ending of this month I will be submitting my project work. 'final year project' but now the only thing left is search 🔎 systems where an admin can search for a student or books 📙
@tukurhamid
@tukurhamid 17 күн бұрын
Thank you bro, this is helpful
@joel9909
@joel9909 Жыл бұрын
The backend course I will be doing (Meta) uses Django, and I am also interested in Node. But mehn Fast Api seems powerful too, and Flask seems easy enough to prototype things with speed Subscribed
@JaimeSilva
@JaimeSilva 2 жыл бұрын
Dam boooy! I have just read all the comments! I started using Django for fullstack about 3 years ago. I work mostly by myself so I don't need to separate frontend from backend. I'm curious about FastAPI but it's a struggle with the community when you're comming from the Django world. When I'm stuck with Django I'm likely to find the solution in the internet more easily than with FastAPI and that's easy to understand because Django been around for much longer. The most captivating thing for me in FastAPI is the assychronous part. I tried Django Channels but it's relatively complex. Still think that all the frameworks are being updated constantly so I'm not too dramatic about the "best choice".
@vhaangol4785
@vhaangol4785 2 жыл бұрын
_"Still think that all the frameworks are being updated constantly so I'm not too dramatic about the "best choice""_ - Right on point sir. I agree that Django Channels is a bit complex, but there have been prod applications that have integrated Django Channels decently. Check out baserow.
@JaimeSilva
@JaimeSilva 2 жыл бұрын
@@vhaangol4785 Thanks for pointing! I'm gonna take a look at that one!
@marcvanoldenborgh6218
@marcvanoldenborgh6218 Жыл бұрын
Thanks Patrick, for this excellent work.
@Sam-tg4ii
@Sam-tg4ii Жыл бұрын
10:14 Can the FastAPI's documentation page be used as a GUI for the API where the user POSTs values and gets responses back? Can it be hosted on a server for public access?
@josemariadiy6400
@josemariadiy6400 2 жыл бұрын
Hi Hola, buen video 👍 Consulta: de los 3 frameworks: Django, FastApi y Flask... Cuál recomendarias para este 2022.o 2023.?? Saludos
@LukePighetti
@LukePighetti Жыл бұрын
was hoping for a retrospective at the end!
@ginofrigoni
@ginofrigoni 2 жыл бұрын
La verdad muy bueno, rápidamente logré ver las diferencias
@eugy2008
@eugy2008 2 жыл бұрын
Pat, If this video was a lot of work you didnt answer the main question: "Which Python Framework is best?" Framesworks have slight differences but that's about all you talked about.
@Marco-cx6gp
@Marco-cx6gp 2 жыл бұрын
What's the theme you're using? it's so neat! I want it
@keyone415
@keyone415 2 жыл бұрын
My favorite is Golang :)
@biojui1
@biojui1 10 ай бұрын
Great video! thanks for the examples
@iAmAlby
@iAmAlby 11 ай бұрын
I’m new to learning python. I’m watching this with limited knowledge over 95% of what’s being presented. This seems like a lot to remember. How much of this is expected knowledge vs googled?
@k2icc
@k2icc 2 жыл бұрын
Similar stuff on Stremlit or out of the equation for what is used for?
@PedroGrilo13
@PedroGrilo13 2 жыл бұрын
Clear and concise video. Thanks :D
@fafaratze
@fafaratze 2 жыл бұрын
ill go with flask, if the project goes big, Blueprint is there to organize stuffs. very flexible, i can choose any library for my database ~ ORM/non-ORM. The thing I don't like about Django is its forcing me to go by its way. but in anyways, if its just web development, ill go with PHP, because PHP just works, it lightweight, less configuration, very flexible. If i want to run a python scripts, ill just use php to execute it.
@satawatroipee588
@satawatroipee588 Жыл бұрын
Can we create database files by coding?
@StephenRayner
@StephenRayner Жыл бұрын
I was hoping for a performance companies. But this is useful as well.
FastAPI, Flask or Django - Which Should You Use?
9:49
Tech With Tim
Рет қаралды 67 М.
How to create a great dev environment with Docker
29:55
Patrick Loeber
Рет қаралды 259 М.
Это реально работает?!
00:33
БРУНО
Рет қаралды 4,3 МЛН
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 6 МЛН
I built 10 web apps... with 10 different languages
14:23
Fireship
Рет қаралды 1,6 МЛН
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,4 МЛН
Why You NEED To Learn FastAPI | Hands On Project
21:15
Travis Media
Рет қаралды 158 М.
Qwik… the world's first O(1) JavaScript framework?
3:33
Fireship
Рет қаралды 669 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 381 М.
Python FastAPI Tutorial: Build a REST API in 15 Minutes
15:16
Flask vs Django in 2024 - Make a RIGHT Choice (Difference Explained)
9:32
Daniel Dan | Tech & Data
Рет қаралды 44 М.
7 Years of Software Engineering Advice in 18 Minutes
18:32
Learn to code with an unfair advantage.
15:05
Jason Goodison
Рет қаралды 172 М.