Your tutorials were a huge influence on me as I began learning to code in my late 20’s and had a profound impact allowing me to start two companies and helped give me a toolset I didn’t have before. Thanks for all you do!
What do you think about the current state of Flask and Flask extensions? Are they being maintained and up to date? Or would it better to go with FastAPI and use its non-async features to have the same Flask like experience?
Your Flask tutorials are my webapp I Ching. Thanks a bunch. Just about to launch another Flask webapp in the next few weeks, and your tutorials are invaluable.
Oh! Before I forget - flask-migrate! Lifesaver! Thanks Miguel!
No questions, just praise: I loved this tutorial, it was hugely helpful to me when I was just getting into python and I regularly recommend it. Thanks for writing it and sharing it!
Same as most of the replies, just wanted to send my thanks for the tutorial. I used your original tutorial (before the function name change) for my dissertation platform and its been running for 6 years now.
Hi, I never finished your tut but it was a impressive to see the surface covered. I'm curious, are you still using flask ? have you tried FastAPI or Django or something else ?
Hey Miguel, wanted to thank you for creating this tutorial. It started my freelancing career and I created great projects based on it. Thank you very much!
I can second that Miguel's tutorial is quite nice and sufficient to build Flask apps.
Thanks to Miguel (and also official Flask docs) I have some Flask Apps running non stop for a few years by now.
Flask is extremely easy to write in regards that the mental model is easy to follow.
Sure there is magic there but the abstractions seem "non-leaky". By contrast I can't get into Django because it seems too much magic.
The worst part of using Python for back end was deployment.
Setting up WSGI server to host Python apps was a bit of a pain.
Coming from Rails, I appreciate Django's less-magical approach. I admit it has some silly limitations though, like not being able to call methods with arguments in templates, and the whole mixin view generic classes, just to name a few
That being said, Django is great, and so is Python :)
This is how I started my journey with web development.
I was a Data Scientist and I superficially used Flask to build an internal matching tool between internal products and competitors product (after an ML model).
Then I started the Mega-Tutorial to build a small app to track our foosball matches and run a team tournament.
Eventually, I wanted to accelerate my learning and joined a bootcamp (Le Wagon) where I learned Ruby on Rails from scratch. My Flask introduction with this tutorial was really helpful to understand things on almost all layers.
I always recommend this tutorial to people who come from Python and want a sneak peak to web development. I am very grateful for Miguel's work and for sharing it.
Miguel has updated this guide (available for purchase). In my opinion, it's worth every penny as a starting point into building larger Flask apps, but does include some material that isn't optimized for production-ready Flask apps (e.g. the chapters on authentication).
I learned to use Flask with this tutorial, which complemented the already good Flask documentation. This allowed me to spin-up web interfaces to make monitors, remote control panels and so on very easily. Than you very much Miguel, it was a great gift.
This was my go to for learning Flask, I wish I never found it. Flask has a very niche use case in my opinion and if you need something to scale (in terms of code complexity) Flask is the absolute worst decision you can make.
Try Django instead. If you read my comment history you'll see that I learnt this the hard way.
In my experience it's quite the opposite. We use Flask for a large-scale webapp in production quite successfully and it's enabled us to reduce application complexity significantly.
While you get up and running faster with Django, in the long run you spend more time fighting it, whereas with Flask you only spend time on stuff that you actually need.
strongly disagree with this. flask is what you make of it. you create your design patterns. for example, here's an MVC boilerplate i use for all my flask apps: https://github.com/esteininger/flask-mvc-boilerplate
After reading your comment history and searching it, it seems to me that you never learned to use Flask. Jumping into new project and learning a framework at the same time means that you may have to restructure everything after you have learned it.
For the items covered in this tutorial, I would rather recommend Django. Better documented and arguably more suited to the task. For an API alone e.g. along with an SPA I would consider FastAPI.
Miguel is a great teacher; it's difficult to find proper (up to date!) text-based tutorials in this era. I will also give a shoutout to his recent React Mega-Tutorial, which I've been learning and using his tutorial as one of my sources for learning React.
I did his flask tutorial a year + ago before I started learning react. I'd love to see the workflow for developing a backend Flask API first (without Jinja/render_template). It seems less straight-forward than FastAPI which I am using because I think it's simpler to develop APIs first (ala the name)
fastapi is valuable and useful tech. But it's also very over hyped with all the it's fanatics trying to throw it at every problem. Simple admin dashboard for few dozen users? FASTAPI. Backend for a mobile app? FASTAPI.
There is more useful and battle tested solutions out there for flask than fastapi (due to it's obvious time in the market, but still).
It's also interesting to check number of github issues for both frameworks (14 vs >1k).
I'm somewhat of a Flask pro but have struggled to find a good entry on how to use it as a backend for a native iOS app (for someone who completely missed the Swift train). I guess it starts with migrating to Fastapi?
Speaking of backend development, recently I gave Jooby[1] a try after discovering it was one of the world's top performer in Tech Empower's web framework benchmark[2].
Surprisingly enough, it's terribly easy to put together a REST API with Jooby. I was expecting a lot of arcane tricks to set things up, but it's one of the less.verbose frameworks out there.
Not using Flask, but I've been using Django as backend for various iOS apps over the years. My recipe is just a REST API library + Django OAuth2 Provider. I imagine if I were to use Flask, I'll do the same thing: implementing the REST API and gate it using OAuth2. Plenty of library in iOS side that make hooking up with OAuth2 relatively easy.
What is flask missing? FastAPI has swagger and open api stuff but it’s not like it’s required or necessary most of the time. I use my basic flask server as the most dead simple rest API backend for my iOS apps without any issues
As others have said: What has one to do with the other? As a Flask pro you probably know that you can create great APIs with it. And iOS apps can consume them.
[+] [-] miguelgrinberg|3 years ago|reply
Happy to see people continue to find my tutorial useful and relevant. If you have any questions, I'll be happy to answer.
[+] [-] kyle_morris_|3 years ago|reply
[+] [-] iknownothow|3 years ago|reply
[+] [-] alejoar|3 years ago|reply
[+] [-] cushychicken|3 years ago|reply
Your Flask tutorials are my webapp I Ching. Thanks a bunch. Just about to launch another Flask webapp in the next few weeks, and your tutorials are invaluable.
Oh! Before I forget - flask-migrate! Lifesaver! Thanks Miguel!
[+] [-] john-radio|3 years ago|reply
[+] [-] hkt|3 years ago|reply
[+] [-] manugarri|3 years ago|reply
[+] [-] tsumnia|3 years ago|reply
[+] [-] agumonkey|3 years ago|reply
Thanks again
[+] [-] teruakohatu|3 years ago|reply
[+] [-] mgraupner|3 years ago|reply
[+] [-] kadenwolff|3 years ago|reply
[+] [-] tugberkk|3 years ago|reply
[+] [-] sireat|3 years ago|reply
Thanks to Miguel (and also official Flask docs) I have some Flask Apps running non stop for a few years by now.
Flask is extremely easy to write in regards that the mental model is easy to follow. Sure there is magic there but the abstractions seem "non-leaky". By contrast I can't get into Django because it seems too much magic.
The worst part of using Python for back end was deployment. Setting up WSGI server to host Python apps was a bit of a pain.
https://flask.palletsprojects.com/en/2.1.x/deploying/
I think I went with Gunicorn but there was a bit of learning curve there. I am not even sure if that was the right choice
[+] [-] mritchie712|3 years ago|reply
https://cloud.google.com/run/docs/quickstarts/build-and-depl...
[+] [-] gosukiwi|3 years ago|reply
That being said, Django is great, and so is Python :)
[+] [-] pil0u|3 years ago|reply
I was a Data Scientist and I superficially used Flask to build an internal matching tool between internal products and competitors product (after an ML model). Then I started the Mega-Tutorial to build a small app to track our foosball matches and run a team tournament. Eventually, I wanted to accelerate my learning and joined a bootcamp (Le Wagon) where I learned Ruby on Rails from scratch. My Flask introduction with this tutorial was really helpful to understand things on almost all layers.
I always recommend this tutorial to people who come from Python and want a sneak peak to web development. I am very grateful for Miguel's work and for sharing it.
[+] [-] ryannevius|3 years ago|reply
[+] [-] divbzero|3 years ago|reply
[+] [-] marmakoide|3 years ago|reply
[+] [-] parham|3 years ago|reply
Try Django instead. If you read my comment history you'll see that I learnt this the hard way.
[+] [-] Zr40|3 years ago|reply
[+] [-] nicbou|3 years ago|reply
[+] [-] alexcnwy|3 years ago|reply
Flask is scaling really well for us and it’s flexibility is far better than Django’s opinionated approach.
[+] [-] ibz|3 years ago|reply
While you get up and running faster with Django, in the long run you spend more time fighting it, whereas with Flask you only spend time on stuff that you actually need.
[+] [-] Beefin|3 years ago|reply
[+] [-] whateveracct|3 years ago|reply
[+] [-] nabla9|3 years ago|reply
That's my impression at least.
[+] [-] sgt|3 years ago|reply
[+] [-] caspii|3 years ago|reply
Flask is fantastic and I would recommend it to anyone starting out developing webapps.
[+] [-] godmode2019|3 years ago|reply
I built a json ui for my flask apps the other day - Jsonify - https://github.com/xzava/jsonify
While I am a flask fan, a lot of good things can be said about fastapi.
[+] [-] trashm3|3 years ago|reply
I did his flask tutorial a year + ago before I started learning react. I'd love to see the workflow for developing a backend Flask API first (without Jinja/render_template). It seems less straight-forward than FastAPI which I am using because I think it's simpler to develop APIs first (ala the name)
[+] [-] drcongo|3 years ago|reply
[+] [-] 4dregress|3 years ago|reply
[+] [-] Zababa|3 years ago|reply
[+] [-] Tyrannas|3 years ago|reply
[+] [-] wiktorcie|3 years ago|reply
There is more useful and battle tested solutions out there for flask than fastapi (due to it's obvious time in the market, but still).
It's also interesting to check number of github issues for both frameworks (14 vs >1k).
Nonetheless fastapi is great.
[+] [-] samwillis|3 years ago|reply
[+] [-] jyriand|3 years ago|reply
[+] [-] nagestri|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] nchudleigh|3 years ago|reply
[+] [-] marban|3 years ago|reply
[+] [-] arinlen|3 years ago|reply
Surprisingly enough, it's terribly easy to put together a REST API with Jooby. I was expecting a lot of arcane tricks to set things up, but it's one of the less.verbose frameworks out there.
I wonder why it's adoption rate is so low.
[1] https://jooby.io/
[2] https://www.techempower.com/benchmarks/
[+] [-] neurostimulant|3 years ago|reply
[+] [-] darkstar_16|3 years ago|reply
[+] [-] rhodysurf|3 years ago|reply
[+] [-] mgraupner|3 years ago|reply
[+] [-] aiibe|3 years ago|reply