Reference#

This part of the documentation describes the machinery: what each setting, attribute, field, and function is, and nothing else.

Configuration and formats#

⚙️ Settings

Every environment variable, its default, and its meaning.

Settings
🧭 The route directive

Attributes, behavior, and configuration errors of <ploneasgi:route />.

The route directive
📜 Access log format

Fields, notes, and options of the access log.

Access log format

Python API#

Every module but ploneasgi.testing imports without Plone installed.

Composing and serving#

app.create_app([settings, routes, ...])

Build the Starlette application with Zope mounted at /.

app.serve(app[, settings])

Run the application under uvicorn.

app.default_adapter(wsgi_app, settings)

Wrap a WSGI app in this package's adapter.

settings.Settings

Runtime configuration for an ASGI-hosted Plone.

settings.load_env([path])

Load a .env file, if present.

settings.setup_logging(settings)

Configure logging for the no-ini case.

zopeapp.build_wsgi_app(settings)

Build the Zope WSGI application without PasteDeploy.

zopeapp.check_concurrency_contract(settings)

Warn when the WSGI worker count can outrun the ZODB connection pool.

zopeapp.lifespan(app)

Own the process lifecycle that runwsgi + waitress used to provide.

Serving Zope#

wsgi.WSGIMiddleware

Mount a WSGI application inside an ASGI application.

wsgi.build_environ(scope, body)

Build a PEP 3333 environ from an ASGI HTTP scope.

accesslog.AccessLogMiddleware

Log every HTTP request and websocket session in one consistent format.

Native routes#

vhm.VirtualHostMiddleware

Route VirtualHostMonster-rewritten requests to native ASGI routes.

vhm.parse_virtual_host(path)

Parse a VirtualHostMonster-rewritten path.

vhm.VirtualHost

A parsed VirtualHostMonster rewrite.

zcml.routes_from_registry([registry, prefix])

Collect every ZCML-registered route as a Starlette route.

zcml.build_route(route[, prefix])

Turn a registration into a Starlette route.

zcml.ASGIRoute

One registered route, as declared in ZCML.

context.run_authenticated(scope, work, *, ...)

Run work in a worker thread with an authenticated Plone context.

context.limiter_for(scope)

The ZODB limiter of the application serving a request.

context.PloneContext

What a unit of work is handed inside the worker thread.

context.default_db()

The process-wide ZODB set up by Zope's startup.

Testing#

testing.FUNCTIONAL_TESTING

Anything that reaches Plone from another thread: native routes, run_authenticated(), a server driven over HTTP.

testing.INTEGRATION_TESTING

Single-threaded tests only.

testing.PLONEASGI_FIXTURE

The shared fixture: a Plone site with plone.app.contenttypes and the route directive's meta.zcml.

The module pages document every public name, one page per module: ploneasgi.app, ploneasgi.settings, ploneasgi.wsgi, ploneasgi.accesslog, ploneasgi.vhm, ploneasgi.zcml, ploneasgi.context, ploneasgi.zopeapp, and ploneasgi.testing.