Skip to content

First Production Run

This guide turns a local app into a production-shaped runtime setup.

1. Configure settings explicitly

Use an explicit settings class for environment-specific behavior.

LILYA_SETTINGS_MODULE=src.configs.production.ProductionSettings palfrey myapp:app

See Settings for precedence details.

2. Pick an ASGI server strategy

Common choices:

  • palfrey for Lilya-native workflows
  • uvicorn for broad ecosystem compatibility
  • hypercorn for multiple async backends

3. Apply minimum production baseline

  • debug=False
  • Host validation via TrustedHostMiddleware
  • Structured logging via Logging
  • Shared cache backend for multi-worker environments
  • Health endpoint and smoke test

4. Add deployment packaging

Use the deployment docs for containerized and non-containerized setups:

Next steps