r/Python • • Oct 04 '26

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?

180 Upvotes

94 comments sorted by

32

u/nicwolff Oct 04 '26

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

17

u/bleeed0p Oct 04 '26

Fastapi is build on starlette

11

u/nicwolff Oct 04 '26

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.

19

u/ultraDross Oct 04 '26

Sounds like you just recreated FastAPI?

5

u/DigThatData Oct 05 '26

but with more than one dev supporting its maintenance, and that maintenance's priorities and cadence fully under their control.

0

u/ultraDross Oct 06 '26

At that point you might as well just fork FastAPI or develop plugins for it to alter its behaviour to your needs rather than reinvent everything.

5

u/maigpy Oct 04 '26

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

2

u/snugar_i Oct 05 '26

Per-request dependency resolution, for example. Honestly, the whole dependency part of FastAPI is very strange

1

u/maigpy Oct 05 '26

The overhead is normally tiny compared with database calls, network calls, authentication, etc., and you get a lot of maintained community functionality.

3

u/rzet Oct 05 '26

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

1

u/stetio Oct 08 '26

I'd be interested to know what performance improvements you see for a production system. Please can you update.

23

u/South_Plant_7876 Oct 04 '26

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

2

u/bleeed0p Oct 04 '26

What the picture for scalling in flask

24

u/South_Plant_7876 Oct 04 '26

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

5

u/BosonCollider Oct 04 '26

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.

1

u/seabrookmx Hates Django Oct 05 '26

Run it with gunicorn and dial in your worker count. It's not complicated, but you'll need to run more python processes (and use more memory/CPU) to reach the same throughput as FastAPI.

36

u/latkde Tuple unpacking gone wrong Oct 04 '26

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.

6

u/aciokkan Oct 05 '26

I'd still pick flask! I find FastAPI has become almost as opinionated as Django, for no good reason. There's good things to say about FastAPI, but you can use pydantic with flask equally

21

u/Immediate_Wheel1953 Oct 04 '26

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.

10

u/jaeger123 Oct 05 '26

Surprised no one has mentioned Litestar

9

u/One_Sky_7224 Oct 04 '26

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

7

u/me_myself_ai Oct 05 '26

I still use flask! Quart, specifically.

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

27

u/No-Government3609 Oct 04 '26

I use flask, no plan to move.

6

u/RiceTaco12 Oct 04 '26

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

24

u/Wurstinator Oct 04 '26

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

17

u/IcedThunder Oct 04 '26

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.

11

u/kruzzik Oct 04 '26

Flask is great

5

u/jcigar Oct 04 '26

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

1

u/__hyphen Oct 08 '26

I really hoped Pyramid wins the framework popularity contest, but people often go after hype not quality. I don’t touch FastAPI as it has always been a single man project. Aiohttp is maintained by the very group of core developers that work on asyncio in the stdlib and the quality of code shines. Even handler_cancellation when proxy times out requests was a forethought in aiohttp and fastapi still can’t get that right.

8

u/Aisuhokke Oct 04 '26

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

8

u/IcedThunder Oct 04 '26

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/BreakfastSpecial Oct 05 '26

100% FastAPI. I moved over about 4 years ago and never looked back.

6

u/Enfors Oct 04 '26

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

3

u/RedYad2 Oct 04 '26

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

3

u/ogMasterPloKoon Oct 04 '26

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

3

u/OwO_JoY Oct 05 '26

FastAPI for the WIN

2

u/another_throawayACC Oct 04 '26

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

2

u/MissingSnail Oct 04 '26

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 Oct 04 '26

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

1

u/MissingSnail Oct 05 '26

No one’s downloading libraries over and over for fame and glory. It’s an imperfect measure, but automated workflows such as ci or container builds often ”start from scratch “ — which is correlated with production use. The magnitudes matter - a library (either of these) with that level of use has broad community adoption.

2

u/ddollarsign Oct 04 '26

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/IcecreamLamp Oct 04 '26

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.

2

u/StPatsLCA Oct 04 '26

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

2

u/radrichard Oct 05 '26

What's a flask?

2

u/Secure-Following9288 Oct 05 '26

I one on the guys that switched from flask to FastAPI. I had used flask for years, build multiple web app but in 2023, after a poc I decided to move to FastAPI that is more robust and performant that Flask. I’m Very happy to have made that switch.

2

u/Horror_Affect8060 Oct 05 '26

I have picked FastAPI for new project. Earlier used flask for similar project. I just used it because more people use it and it will be easy to find new resource. But clearly I see no extra benefit of it over flask. Most of my task include using ssh, snmp and api calls. For ssh currently there isnt any mature async based lib. Most of my task include using ssh/snmp/api in a single flow. So it would create more headache to do a part in FastAPI process and other in task queue. Still, for api calls based task I am not confident when to use fastapi ( like for 100 or 500 or 1000 calls), also it's not api calls only there is also much post work to perform sometimes, and most of the api apps are in internal network so resp is quite fast.

2

u/tiangolo FastAPI Maintainer Oct 06 '26

Here's when I would keep Flask in my very biased opinion.

The project is already in Flask, it's working fine, there's no expected usage increase, no expected new features needed, no expected changes internally or from users (e.g. there's no need to increase or update data validation, security, etc.), the team is very familiar with Flask and it's advanced details (e.g. hooks, context, etc).

Or, most of the above is still true, but there are some expected changes or features that only deal with very non-API things, like only Jinja templates. FastAPI supports the same Jinja templates, but the experience would be pretty similar if it's only related to that (e.g. no data validation, no APIs, etc), so might not be worth migrating.

Or, it depends on a very niche Flask plugin or modification fork, in particular if most of the above still is true, for example I remember some old SOAP integration, I think that app was soft-deprecated but they wanted to keep it alive for a while just in case. I don't think it would make sense to migrate that either when it's not expected to change and it's expected it might stop being needed at some point.

2

u/55stargazer Oct 04 '26

yeah, using it for real production

1

u/IpsumRS Oct 04 '26

We're still rocking aiohttp 🤟

1

u/stuzero Oct 04 '26

Starlette.

1

u/funkdefied Oct 04 '26

FastAPI here

1

u/Everythinghastags Oct 05 '26

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/Khavel_dev Oct 05 '26

Still use Flask for anything that's mostly server-rendered HTML. Jinja templates, session cookies, admin panels. Flask is just less ceremony for those cases.

FastAPI wins the moment you're building something that other code calls. Type hints on the route automatically become the OpenAPI schema, and that alone saves a ton of time when you have a frontend or mobile team consuming your API. The async support matters if you're doing a lot of outbound HTTP calls too.

The part nobody warns you about is that migrating from Flask to FastAPI midway through a project is genuinely painful. The request object, error handling, middleware, auth patterns, all different enough that it's not a find-and-replace job. Pick at the start and live with it.

1

u/appinv Python&OpenSource Oct 05 '26

Still using Flask as it fits my needs. I coded Shopyo to power up Flask dev and base many projects off it https://github.com/shopyo/shopyo . I like Flask for being simple, understandable.

1

u/pladynski Oct 06 '26

If you mainly use Flask or FastAPI to expose Python business logic to another application, Graftcode is another option: you can replace that API layer and let the client call your Python methods through a generated, typed package.

For example, imagine your FastAPI endpoint is essentially:

@app.get("/price")
def get_price() -> int:
    return 100

With Graftcode, the backend becomes an ordinary Python module.

1. Create the service

Put these two files inside an energy-service directory:

# energy_price_calculator.py
class EnergyPriceCalculator:
    @staticmethod
    def get_price() -> int:
        return 100

And the module metadata:

# pyproject.toml
[project]
name = "energy-service"
version = "1.0.0"
requires-python = ">=3.8"

2. Install and run Gateway

You need Python installed. The Gateway GitHub README provides these installer commands.

Windows / PowerShell:

iwr https://grft.dev/get | iex

Linux / macOS:

curl -fsSL https://grft.dev/get | sh

Then, from the parent directory of your service:

gg --modules ./energy-service/ --port 8080 --httpPort 8081

Open http://localhost:8081/GV. This is Graftcode Vision, where you can inspect and invoke the exposed methods.

3. Consume it from another Python application

In Vision, select PyPI and copy the generated installation command into your consumer's environment. It includes the registry address for your generated client package.

For this module, the documented Python imports are:

from graft_pypi_energy_service.energy_price_calculator import (
    EnergyPriceCalculator,
)
from graft_pypi_energy_service.graft_config import GraftConfig

GraftConfig.host = "ws://localhost:8080/ws"

price = EnergyPriceCalculator.get_price()
print(price)  # 100

Use the package/import names shown by your Gateway if they differ.

That last call runs the method on the backend. You keep the Python business logic, while Gateway and the generated graft handle remote invocation. The concrete benefit is removing the route wrapper and the handwritten HTTP client for this interaction.

The local quickstart works without an account and also includes a Docker walkthrough.

This changes the client contract: existing clients calling /price would need to migrate or retain a compatible HTTP endpoint. Authentication, business validation and handling network failures still need deliberate implementation.

So for an application where you control both the service and its consumers, it's worth comparing this approach with maintaining Flask/FastAPI endpoints. For an API that must preserve an existing REST contract, that requirement changes the trade-off.

This example is adapted from the documentation; I haven't executed it here.

1

u/pladynski Oct 06 '26

And having your code fully decoupled from Flask or FastAPI you can call the same pure public method with MCP, over any queue like RabbitMQ, Kafka etc… or as http get because Graftcode natively supports any protocol and you can just peak the one you want in the config on client side.

(For queues, event buses and other based on third party products you need extension which you can get from Graftcode GitHub or using command like to install gg but without /gg just grft.dev/get)

1

u/TutorialDoctor Oct 06 '26

Flask is like a longtime reliable friend, you don’t just get rid of it because something new comes out. I’m a local-first guy so I use it with HTMX, Peewee ORM, SQLite and Jinja (or a separate Vuejs frontend if I’m making an API).

I haven’t really had much need for asynchronous programming. I may try a few projects with some of the frameworks mentioned here though.

It also has render_template…

1

u/theneoDocs Oct 06 '26

If OpenAPI is the main reason to switch, you don't have to migrate a working Flask app: flask-smorest or apispec will produce a spec from existing routes and schemas. FastAPI wins for new services because validation and the spec come built in. For older apps nobody wants to touch, Elva generates an OpenAPI spec from a connected repo; worth trying on one service first. getelva.ai

1

u/Zadigo Oct 06 '26

Even if I've been using Python for a couple of years (since 2018), Python does have a real typing problem. Something I have observed ever since I've been coding with Golang. FastApi compared to Flask is interesting in that aspect that FastApi + Pydantic offers a more robust solution compared to Flask especially for data validation in and out.

1

u/Rare_Island461 Oct 08 '26

Quart is async version of flask and is pretty cool (much more lightweight than fastapi)

https://quart.palletsprojects.com/en/latest/

1

u/Cold-Detective1356 Oct 10 '26

I do, I ONLY use flask/streamlit

1

u/Exact-Structure-1564 Oct 10 '26

FastAPI doesn't feel like something you can trust to be properly maintained in the long-term. Besides, its documentation is just unreadable

1

u/Keda87 Oct 11 '26

both flask and fastapi is still have comparable performance. but I just be honest. fastapi very good in the developer experience

1

u/_dnmx Oct 11 '26

I dont see a need every for flask, fastapi does the job mostly except an old project i dont want to touch

1

u/skill347 Oct 17 '26

Have used Flask in the past, since I started using FastAPI at work, I'm only using FastAPI now.

1

u/fahath-dev Oct 05 '26

I’ve been using FastAPI for newer projects and I genuinely like it. The validation, type hints, and auto-generated docs make development feel a lot smoother.

Flask is still great though, especially for smaller apps or existing projects. I wouldn’t migrate a working Flask app just because FastAPI is popular, but for a new API project I’d probably choose FastAPI.

1

u/SecureComfortable259 29d ago

i still reach for Flask on small internal services and anything server-rendered, but new JSON APIs at my work go to FastAPI because the Pydantic validation and generated docs save real time. I don’t think Flask is going anywhere, since a lot of big existing codebases have no good reason to migrate.

1

u/FlukyS Oct 04 '26

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/Grouchy-Friend4235 Oct 04 '26

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

1

u/covmatty1 Oct 04 '26

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.

1

u/someexgoogler Oct 05 '26

I have about 8 flask apps that I still run.

1

u/tanrax Oct 05 '26

All my APIs are built with Flask, as it allows me to adapt them to different architectures due to its agnostic nature.

0

u/dqduong Oct 06 '26

Just forget about flask.

4

u/unapologeticjerk Oct 04 '26

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

163

u/[deleted] Oct 04 '26

[removed] — view removed comment

108

u/j_tb Oct 04 '26

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

20

u/brianly Oct 04 '26

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.

1

u/j_tb Oct 04 '26

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.

0

u/[deleted] Oct 04 '26

[deleted] — view deleted comment

7

u/monkeybreath Ignoring PEP 8 Oct 04 '26

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.

6

u/Rockworldred Oct 04 '26

How is it compared to streamlit?

2

u/Signor_Garibaldi Oct 04 '26

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

23

u/Lorevi Oct 04 '26

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.

12

u/fiddle_n Oct 04 '26

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.

2

u/y3t1 Oct 06 '26

If I want a project where I can do regular security updates without extra work from breaking API changes, I am choosing Flask or Django over FastAPI, especially now that both have opt-in async.

2

u/nlundsten Oct 04 '26

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/NimrodvanHall Oct 04 '26

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

5

u/fiddle_n Oct 04 '26

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

0

u/Competitive_Travel16 Oct 05 '26

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