FastAPI is more focused on making it easy to make APIs, especially with the built-in Swagger docs generation (I don't believe Flask has this out-of-the-box).
So if your greenfield project is more web-based (clients are web browsers), Flask may be more suited. If your greenfield project is service-based (command line applications, or front end), FastAPI may be more suited.
In both cases, it's as easy to substitute one for the other. Personally I'll be trying out FastAPI since the dev experience seems a lot nicer (integration with `pydantic`).
Edit: Thanks for the correction, my point is moot and irrelevant.
> When you declare a path operation function with normal def instead of async def, it is run in an external threadpool that is then awaited, instead of being called directly (as it would block the server).
Flask itself doesn't support swagger out of the box (much like security or login/auth) but the community has you covered.
IMHO go with whatever one you know and don't depend too much on any special features or framework-specific things that aren't critical. You're likely going to throw away and rewrite whatever you produce many times throughout its lifetime if it gets some legs and grows.
What “headaches” have you encountered with Python/Flask in relation to deploying, managing, scaling? Specifically, what headaches have you encountered that are not present in every platform/language? Are you a NodeJS dev?
You seem to be suggesting that there is a much simpler / better alternative. What is it?
Bottle is the simpler Flask
It seems like it was probably just a misunderstanding due to an ambiguous way someone could interpret your post. I see what you likely actually meant, now, and that you probably weren't talking about some issue with Python but about different levels of complexity in deployment in general, but I also initially misinterpreted it like the other posters did and thought it was a jab at Python.
So everyone was basically misunderstanding everyone else and mutually thought they were being baited even though they weren't, I think.