by stevenhuang · 5y ago · 0 comments
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.
Flask itself doesn't support swagger out of the box (much like security or login/auth) but the community has you covered.