r/FastAPI • • Jul 29 '21

Question What does Flask have that FastAPI doesn't currently have?

I would like to help FastAPI/Starlette overtake flask to become the de facto framework for microservices and REST APIs. (I think Django projects generally target a different use case so I'm less concerned with trying to gain feature parity with Django)

I'm currently creating a comparison of similar 3rd party libs from each framework by cross-referencing:

I'm wondering if any of you with flask experience ever have feelings of:

I wish FastAPI had an equivalent of flask feature/plugin 'X'

Depending on the scope of the feature I'd like to try to implement or improve the biggest gaps between FastAPI and flask. Either by contributing to an active repo or creating my own.

For context, I've been working with FastAPI/Starlette/pydantic and asyncio on/off for around 2 years.

15 Upvotes

12 comments sorted by

View all comments

0

u/[deleted] Jul 30 '21

[deleted]

3

u/PeterJHoburg Jul 30 '21

Async SQLAlchemy is pretty easy to do, assuming the DB dialect and driver you are using support async.

https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html

And as far as I know Django ORM still isn't Async. Other parts of Django are finally async, but the ORM isn't.

0

u/[deleted] Jul 30 '21

[deleted]

2

u/wrtbwtrfasdf Jul 30 '21

I encountered the same issue with databases so I gave up on it(perhaps prematurely).

Unfortunately, SQLAlchemy is in a really weird spot right now with support split between 1.3,1.4, and 2.0. I think you more or less have to just settle for 1.3 if you want an async integration atm. I'd look into gino it's actively-developed and has FastAPI integrations. They are currently on sa v1.3 but plan to match their future releases with sa(ie v1.4 gino w/ v1.4sa, v2.0gino w/ v2.0sa ).

GINO - GINO Is Not ORM - is a lightweight asynchronous ORM built on top of SQLAlchemy core for Python asyncio