Guide¶
The guide explains every feature of the core patera package. Each page can be read on its own;
read them in order for a complete tour.
Fundamentals¶
- Configuration: typed settings from classes and environment variables.
- The application class: lifecycle hooks, extensions and useful members.
- Services and dependency injection: singleton services and
Inject[...].
HTTP¶
- Controllers and routing: endpoints, route parameters, validation and hooks.
- Requests: headers, bodies, forms, files and request context.
- Responses: JSON, templates, streaming, files, cookies and response models.
- Exception handling: handler classes and default error responses.
- Middleware: wrap the request chain.
- CORS: cross-origin settings, globally and per endpoint.
- WebSockets: socket endpoints in controllers.
Content¶
- Templates: Jinja2 rendering.
- Static files and static pages: files and controller-less HTML pages.
- OpenAPI: generated specification and Swagger UI.
Operations¶
- Logging: Loguru, JSON Lines log files, custom sinks and request observers.
- Command line interface: CLI controllers and commands.
- Testing:
PateraTestClientandpatera test. - Coding agents: generate instructions for Codex and Claude.
Building on Patera¶
- Custom extensions: write reusable services and packages.