Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with flask async routes #2525

Open
williamhakim10 opened this issue Sep 16, 2024 · 0 comments
Open

Compatibility with flask async routes #2525

williamhakim10 opened this issue Sep 16, 2024 · 0 comments

Comments

@williamhakim10
Copy link

Currently, flask-admin does not easily support flask routes declared as async (see https://flask.palletsprojects.com/en/3.0.x/async-await/). While this isn't a dealbreaker, if you have a bunch of async code (e.g., if you're using flask-admin alongside a Quart app), then it's pretty annoying to have to manually wrap all your code in asyncio.run(...) (or loop.run_until_complete(...)). My understanding is that the limitation stems from the expose decorator which does not call ensure_sync. It would be nice if expose could wrap async functions, or if expose_async existed as an alternative. I'd be happy to help with a PR if either of these approaches seem reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants