ploneasgi.settings#
Environment-only configuration, replacing the PasteDeploy .ini.
- ploneasgi.settings.LOG_FORMAT = '%(asctime)s %(levelname)-7.7s [%(name)s:%(lineno)s][%(threadName)s] %(message)s'#
Mirrors
formatter_genericfrom the generatedzope.ini, so log output stays recognizable after dropping PasteDeploy.
- ploneasgi.settings.load_env(path=None)[source]#
Load a
.envfile, if present.Must be called before any Zope import or configuration read.
load_dotenvdoes not override variables already in the environment, so a container's real environment always wins over a local file.
- class ploneasgi.settings.Settings[source]#
Runtime configuration for an ASGI-hosted Plone.
Built from the environment by
from_env()rather than from class-level defaults, so tests can construct an explicit instance without touchingos.environ.- host: str#
Interface to bind.
0.0.0.0is IPv4-only under uvicorn, unlike waitress'slocalhost, which also binds IPv6.
- concurrency: int#
Concurrent WSGI calls. Must not exceed the ZODB
pool-sizeor requests block waiting for a database connection.
- route_prefix: str#
Path prefix reserved for native ASGI routes. Every ZCML-registered route lives under it, which is what lets a deployment keep one proxy rule.
- site_id: str#
Site entered by native routes when a request arrives with no VirtualHostMonster rewrite — direct access, i.e. development. Behind a proxy the rewrite is authoritative and this is unused.
- max_body_size: int#
Largest request body accepted, in bytes; larger ones get a 413 before Zope runs. waitress's default.
0disables the limit.
- __init__(host='0.0.0.0', port=8080, concurrency=4, access_log=False, log_level='INFO', zope_conf=<factory>, chunk_size=262144, route_prefix='/++asgi++', site_id='Plone', max_body_size=1073741824)#
- ploneasgi.settings.setup_logging(settings)[source]#
Configure logging for the no-ini case.
runwsginormally hands the PasteDeploy.initologging.config.fileConfig(), which is where Zope's event log and access log get configured. Dropping the ini drops that too, so configure a plain stream handler instead and let the container collect stdout.Uses
force=Truebecause Zope's startup installs its own handlers: without it,basicConfigsilently does nothing whenever this is called afterploneasgi.zopeapp.build_wsgi_app(), and the access log emits nothing at all. That ordering is easy to hit — it is what a project'sserver.pydoes when it builds the WSGI app itself to collect ZCML routes.- Parameters:
settings (Settings) -- Settings providing the desired log level.
- Return type:
None