runner - Run applications on a local development server¶
Run an aiohttp.web.Application on a local development server. If
debug is set to True on the application, the server will automatically
reload when code changes.
from aiohttp import web
from aiohttp_utils import run
app = web.Application()
# ...
run(app, app_uri='path.to.module:app', reload=True, port=5000)
Warning
Auto-reloading functionality is currently experimental.
-
aiohttp_utils.runner.run(app: aiohttp.web_app.Application, **kwargs)[source]¶ Run an
aiohttp.web.Applicationusing gunicorn.Parameters: - app (
Application) – The app to run. - app_uri (str) – Import path to
app. Takes the form$(MODULE_NAME):$(VARIABLE_NAME). The module name can be a full dotted path. The variable name refers to theaiohttp.web.Applicationinstance. This argument is required ifreload=True. - host (str) – Hostname to listen on.
- port (int) – Port of the server.
- reload (bool) – Whether to reload the server on a code change.
If not set, will take the same value as
app.debug. EXPERIMENTAL. - kwargs – Extra configuration options to set on the
GunicornApp'sconfig object.
- app (