async and asyncio error -- TypeError: 'coroutine' object is not callable async and asyncio error -- TypeError: 'coroutine' object is not callable flask flask

async and asyncio error -- TypeError: 'coroutine' object is not callable


flask is not asynchronous. It is not directly compatible with asyncio at all, and passing a async function to @app.route in a flask application won't work.

I suggest using quart instead.


You should consider using Sanic. It is really fast and handles async requests very well.

with sanic you can consider this solution.