Quart-Flask-Patch
Quart-Flask-Patch is a Quart extension that patches Quart to work with Flask extensions.
Quickstart
Quart-Flask-Patch must be imported first in your main module, so that the patching occurs before any other code is initialised. For example, if you want to use Flask-Login,
import quart_flask_patch
from quart import Quart
import flask_login
app = Quart(__name__)
login_manager = flask_login.LoginManager()
login_manager.init_app(app)
Extensions known to work
The following flask extensions are tested and known to work with quart,
Flask-Limiter See also Quart-Rate-Limiter
Flask-Login See also Quart-Login or Quart-Auth
Flask-SQLAlchemy See also Quart-DB
Extensions known not to work
The following flask extensions have been tested are known not to work with quart,
Flask-CORS, as it uses app.make_response which must be awaited. Try Quart-CORS instead.
Flask-Restful as it subclasses the Quart (app) class with synchronous methods overriding asynchronous methods. Try Quart-OpenApi or Quart-Schema instead.
Caveats
Flask extensions must use the global request proxy variable to access the request, any other access e.g. via ~quart.local.LocalProxy._get_current_object will require asynchronous access. To enable this the request body must be fully received before any part of the request is handled, which is a limitation not present in vanilla flask.
Trying to use Flask alongside Quart in the same runtime will likely not work, and lead to surprising errors.
The flask extension must be limited to creating routes, using the request and rendering templates. Any other more advanced functionality may not work.
Synchronous functions will not run in a separate thread (unlike Quart normally) and hence may block the event loop.
Finally the flask_patching system also relies on patching asyncio, and hence other implementations or event loop policies are unlikely to work.
Contributing
Quart-Flask-Patch is developed on GitHub. If you come across an issue, or have a feature request please open an issue. If you want to contribute a fix or the feature-implementation please do (typo fixes welcome), by proposing a merge request.
Testing
The best way to test Quart-Flask-Patch is with Tox,
$ pip install tox
$ tox
this will check the code style and run the tests.
Help
The Quart-Flask-Patch documentation is the best places to start, after that try searching stack overflow or ask for help on gitter. If you still can’t find an answer please open an issue.
Metadata
Release files for quart-flask-patch 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| quart_flask_patch-0.3.0.tar.gz | 8.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quart_flask_patch-0.3.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 18.0 kB
Release files / quart_flask_patch-0.3.0.tar.gz
| Download URL | quart_flask_patch-0.3.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81dc073698d54ffe1d8c85a556881c13215923a920f9300a02b5005d5447268d
|
|
BLAKE2b-256 checksum How to use checksums |
f65ff1e7642a719ccdd8ef40af4529ba5f0984f90b480dfdce87142826801e6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / quart_flask_patch-0.3.0-py2.py3-none-any.whl
| Download URL | quart_flask_patch-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b5a1d97a8edee9f40082db278fb491687d712af9bc8eb774830ea6f92790b990
|
|
BLAKE2b-256 checksum How to use checksums |
cbcead2b19e3a26d2c611aa883b8500e8b4eb08f8a2d1595e28c37864e54e99c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for quart-flask-patch 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.