| commit | ed796d3a63411e16d9b40f1760fd113a8f5fad9c | [log] [tgz] |
|---|---|---|
| author | Greg Stein <gstein@gmail.com> | Thu Sep 25 18:55:39 2025 -0500 |
| committer | Greg Stein <gstein@gmail.com> | Thu Sep 25 18:55:39 2025 -0500 |
| tree | 8429f6c17b1355b5454239a1ae34972d9f956080 | |
| parent | d718b2eca9df72bdcd780f6f715609c9892cbd16 [diff] |
0.x.y is handled special for version matching. Loosen it up. for 0.1.12
This is a Quart framework for ASF web applications.
On top of Quart, this package layers a lot of functionality, much of which is specific to the ASF and its infrastructure and preferred approaches for website application development.
asfquart adds the following items to basic quart:
APPconfig.yamlCurrent (known, public) users of asfquart:
Future users of asfquart:
See the documentation page for more information.
import asfquart from asfquart.auth import Requirements as R def my_app() -> asfquart.base.QuartApp: # Construct the quart service. By default, the oauth gateway is enabled at /oauth. app = asfquart.construct("my_app_service") @app.route("/") async def homepage(): return "Hello!" @app.route("/secret") @asfquart.auth.require(R.committer) async def secret_page(): return "Secret stuff!" return app if __name__ == "__main__": app = my_app() # Run the application in an extended debug mode: # - reload the app when any source / config file get changed app.runx(port=8000) else: # Serve the application via an ASGI server, e.g. hypercorn app = my_app()
Create and activate a virtual environment and then install asfquart using pip:
$ pip install "asfquart"
Note: Adding the [aioldap] extra will install optional dependencies for LDAP support that will require additional system dependencies:
$ pip install "asfquart[aioldap]"
Prerequisites:
poetry: install e.g. with pipx pipx install poetryBuilding the package:
$ poetry build
Running the tests:
$ poetry run pytest
There is a simple test application included (./examples/snippets/simple_app.py) to outline the basic setup. To run the application in development mode, type:
$ make example-dev
to run it with an ASGI server for production, type:
$ make example-run