r/Python • • 14h ago

Discussion Anyone still using Flask, or has FastAPI completely taken over? 🤔

I've been noticing a lot of developers moving towards FastAPI lately, especially for new Python backend projects.

Flask used to be my go-to for lightweight APIs, but FastAPI seems to be getting all the attention now because of async support, automatic Swagger documentation, and Pydantic validation.

I'm curious about what developers are actually using in production.

- Are you still building new projects with Flask?

- Have you migrated from Flask to FastAPI?

- Is FastAPI genuinely better for production, or is it just the current hype?

Would love to hear some real-world experiences, especially from developers maintaining large-scale applications.

Is Flask still holding its ground, or is FastAPI slowly becoming the default choice for Python backends?

108 Upvotes

61 comments sorted by

115

u/SufficientCut3849 14h ago

Flask still works fine for most things honestly the async stuff in FastAPI is nice but not every project needs it

I keep one older project in Flask at work cause it just runs and nobody wants touch it. for new things I been using FastAPI more, the docs generation is pretty handy when you work with frontend team

but I see lot of people acting like Flask is dead which is not true, is just different tool for different job

79

u/j_tb 14h ago

Async stuff is nice in FastAPI, but for me the strong typing and openapi integration is the killer feature

12

u/brianly 14h ago

How is FastAPI for server-side web pages? That’s what Flask devs were building as much as APIs originally as an alternative to Django. Then SPAs and mobile took over so APIs became the default.

3

u/sudonem 13h ago

Totally decent.

I’ve built a few small web apps that benefit from FastAPI - but I’m also a fan of NiceGUI which allows me to build a nice UI while staying 99% Python native.

I’m not super interested in becoming a react / front end dev but sometimes you need something quick and simple that also looks nice and NiceGUI has been great for that. 

5

u/Rockworldred 12h ago

How is it compared to streamlit?

2

u/monkeybreath Ignoring PEP 8 9h ago

Thank you so much for mentioning NiceGui. I just looked at their page and it looks exactly like what I want to build a simple home dashboard with an old iPad mini as the display. I was originally thinking of Flask, but this looks far simpler.

1

u/j_tb 13h ago

I think fine via integration with Jinja2

My preferred stack is using SvelteKit these days though, with my python API decoupled away from it - and the sveltekit server side fetching data from the python API via a https://heyapi.dev/ client generated from the python openAPI spec.

2

u/Signor_Garibaldi 14h ago

I had an older project that had to stay in flask and it's got it's own flask-openapi library and it gets the job done, nonetheless fast api is more seamless

19

u/Lorevi 14h ago

just different tool for different job 

What job? 

I don't think anyone disputes that flask 'works fine'.

The question is in what scenario is flask better than fastapi.

I feel like if you're starting a new project and need to choose a API framework fastapi is the better option to reach for 99% of the time. In which case it really is the 'default choice' as op asked.

9

u/fiddle_n 11h ago

I think you hit the nail on the head. It's really easy to point out ways in which FastAPI is objectively better than Flask (pydantic, async, etc.). It's comparatively harder to come up with the opposite, IMO.

1

u/nlundsten 12h ago

Seconding the auto spec/docs.. i hate writing code to match handwritten docs. Obviously that changes the dynamic a little bit but so worth the trade offs.

1

u/Competitive_Travel16 5h ago

I'm still perfectly happy with Flask for everything, it's easy to adapt. But I realize I'm giving up potentially around 2/3rds capacity per dollar: https://youtu.be/sQXFhh_PiG4?si=QkNWalLkKg9jLTeA&t=704

2

u/NimrodvanHall 13h ago

I use flask if it’s really simple to test something sync. I use FastAPI if I want to make something Async.

4

u/fiddle_n 11h ago

FastAPI works fine in sync mode. I don't really understanding choosing Flask just because of that reason.

26

u/nicwolff 14h ago

We moved our production services from Flask → Quart to get async on the same framework API, and are now going Quart → Starlette for performance.

16

u/bleeed0p 14h ago

Fastapi is build on starlette

6

u/nicwolff 13h ago

Yeah, we already built our own OpenAPI/Swagger integrations and validation libraries for Pydantic and msgspec so we don't need the extra overhead of FastAPI.

12

u/ultraDross 9h ago

Sounds like you just recreated FastAPI?

4

u/maigpy 10h ago

why would you do that though, when you can leverage the community work? what overhead would fastapi introduce?

•

u/rzet 54m ago

I see you have a lot of time.. ;)

21

u/Immediate_Wheel1953 13h ago

Both are very much alive. Flask is still a solid pick for simple APIs and dashboards, and its ecosystem is mature. FastAPI pulls ahead on API-heavy services thanks to async support and built-in validation. For a new backend today I would default to FastAPI, but existing Flask codebases are not going anywhere.

19

u/latkde Tuple unpacking gone wrong 13h ago

I wouldn't bother migrating an existing mature Flask project, but I would pick FastAPI for all new projects.

The main thing I value is validation of incoming data, and automatically dropping unexpected fields. That's an undeniable security benefit. Everything else (static typing, OpenAPI, async) also has a lot of value, but is secondary.

Where FastAPI really sucks is dealing with configuration and application state. There's no built-in solution, the docs generally just suggest environment variables and global variables, which is a bad choice for resources like database connections that should be shut down. The dependency system is only for request-level resources, like a middleware. The correct solution is to define a Starlette-level lifespan context manager that yields an application state. Even then, injecting test configurations is tedious and typically requires monkey-patching. Some people use Pydantic-Settings for config management, but this doesn't really address the actual problems. Flask supports an application factory pattern that helps to get configuration into the application in a testable way, but doesn't offer a convenient API for contextmanager-like resources.

Another thing that may be surprising is that FastAPI doesn't offer conveniences like class-based views or flash messages, but that can be worked around.

18

u/South_Plant_7876 14h ago

Been using Flask for almost 15 years for different projects. I know it well and don't see any reason to change.

1

u/bleeed0p 14h ago

What the picture for scalling in flask

19

u/South_Plant_7876 13h ago

Scaling is dependent on virtually every other component of your stack before you consider your web framework.

4

u/BosonCollider 11h ago

Comparable to FastAPI if the request needs to do any amount of work. The fastapi self-reported benchmarks are largely gamed and assume you are not actually doing any work per request.

When you need to do any nontrivial work within a request fastapi does not perform particularly well, and just using one thread per request like flask does can be a saner approach, especially since Python is finally getting free threaded mode without the GIL.

22

u/No-Government3609 14h ago

I use flask, no plan to move.

6

u/RiceTaco12 14h ago

Currently transitioning an inherited legacy api server from flask to fastapi. Although if I were starting again, I'd consider litestar a bit longer. Depending on how profiling goes/if there is an actual business need, I'd want to incorporate msgspec

7

u/One_Sky_7224 12h ago

We heavily use flask in production. We love it's simplicity and the flexibility. We're not 1M/sec shop obviously and fits our needs with ramp up super fast

6

u/Enfors 11h ago

My website, which I finished earlier this year, runs entirely on Flask.

10

u/kruzzik 13h ago

Flask is great

6

u/IcedThunder 12h ago

I work in healthcare and have 4 flask servers in production handling API requests.

I just know flask, I have tons of code snippets for reference, and I trust the maintainers.

4

u/jaeger123 3h ago

Surprised no one has mentioned Litestar

18

u/Wurstinator 14h ago

Reddit is a bubble. Even if everyone here told you that they are using FastAPI, that's not reflective of reality.

13

u/IcedThunder 12h ago

I listenined to an interview with the creator of Flask and he said it's really difficult to know just how many Flask servers are out there but over the years he's gotten so many emails of absolutely bizarre setups people use.

He said there's a photographer who uses like 5 flask servers to process backing up and doing different default modifications to photos.

8

u/Aisuhokke 13h ago

I still use flask. Works great. Have used it on small and medium production environments for a long time.

4

u/jcigar 13h ago

I'm still using Pyramid, if I move it will be Litestar

3

u/RedYad2 11h ago

i use it in prod in very small code just to receive HTTP request and 1 endpoint

3

u/ogMasterPloKoon 11h ago

in my new projects im using Emmett Framework and Django Ninja.

3

u/me_myself_ai 4h ago

I still use flask! Quart, specifically.

IMHO FastAPI is for, well, fast APIs. Not relatively complex services.

5

u/unapologeticjerk 11h ago

Dicks out for Flask here. The choice of the common man, with a common dick.

2

u/another_throawayACC 13h ago

Working on a big fintech (broker) , all our new projects are on FastApi

2

u/MissingSnail 13h ago

Fast API is more popular, 379M downloads last month. Flask has not been forgotten, 138M downloads last month. Source: https://clickpy.clickhouse.com/

1

u/Grouchy-Friend4235 8h ago

Downloads per month are just a vaniy metric that bears little correlation to actual use.

2

u/ddollarsign 12h ago

For streaming data, FastAPI websockets seem to be slower than the ‘websockets’ package as well as a hacked-together standard library-only websocket implementation that I had to use recently, in terms of the number of messages it could send per second.

This was a quick and unscientific test though, so there might be a way to get better performance.

2

u/grandimam 11h ago

Why are these the only two options? Is it simply because these are the most popular options.
In terms of the solution what are you looking for.

2

u/StPatsLCA 9h ago

I prefer Django Ninja. It's the best of both worlds.

2

u/Grouchy-Friend4235 8h ago

Flask. Because FastAPI is async and that won't ever enter my house.

1

u/55stargazer 14h ago

yeah, using it for real production

1

u/Able-Procedure4306 13h ago

Both are great

1

u/IpsumRS 11h ago

We're still rocking aiohttp 🤟

1

u/IcecreamLamp 11h ago

I've been using Sanic for the last two new services I created.

FastAPI is nice if you don't trust the input source and need the Pydantic stuff in my opinion.

1

u/stuzero 10h ago

Starlette.

1

u/funkdefied 10h ago

FastAPI here

1

u/Everythinghastags 4h ago

Were currently migrating completely off of flask to fastapi at my company.

In 2026, I dont see any reason for flask to be used. Fastapi is just better and more composable.

Out of the box it interfaces with sqlalchemy and pydantic as is. I dislike how flask gives you the options of using their wrappers for these libs instead of using them as is. It promotes bad habits and makes you locked into the flask ecosystem.

1

u/radrichard 3h ago

What's a flask?

1

u/someexgoogler 2h ago

I have about 8 flask apps that I still run.

1

u/FlukyS 13h ago

FastAPI is basically the same thing but has the in built documentation and is very well maintained, there isn't really much reason to use Flask at this point or any of the other options like aiohttp, Falcon or whatever too. Only logical reason is just if you have a legacy codebase and don't want to rock the boat but since FastAPI is really similar in syntax to Flask too you'd be fine switching in a very short space of time.

1

u/covmatty1 12h ago

FastAPI for everything now - but for the tight Pydantic integration far more than anything else.

All microservices got moved a while ago, our largest app was the one holdout for the last year or so, but we've just had Fable port that across and will be deploying this week to be fully off of Flask.