Framework Integrations¶
waku is framework-agnostic — it handles modular architecture, dependency injection, and CQRS, while Dishka provides integrations with web frameworks and message brokers.
Supported Frameworks¶
Dishka offers ready-made integrations for:
- FastAPI / Starlette / ASGI
- Litestar
- FastStream (RabbitMQ, Kafka, NATS, Redis)
- Aiogram (Telegram bots)
- aiohttp
- Flask
- Django
- and more
See the full list in the Dishka integrations documentation.
FastAPI Example¶
The integration pattern is the same for every framework:
- Create a waku application
- Connect its container to the framework via
setup_dishka() - Use
@injectandInjected[Type]in your handlers
- Manage waku lifecycle through FastAPI's lifespan — this runs extension hooks and shutdown logic.
- Connect waku's DI container to FastAPI so dependencies resolve in route handlers.
@injectfrom Dishka's FastAPI integration enables automatic dependency resolution.Injected[Type]marks a parameter for injection. It is re-exported fromwaku.difor convenience (alias for Dishka'sFromDishka).
Other frameworks
Replace dishka.integrations.fastapi with the appropriate Dishka integration module
for your framework (e.g., dishka.integrations.litestar, dishka.integrations.faststream).
The pattern stays the same — see the
Dishka documentation
for framework-specific details.
Further reading¶
- Application — application lifecycle, lifespan functions, and container access
- Providers — provider types and scopes for dependency injection
- Testing — test utilities and provider overrides
- Dishka integrations — framework-specific integration guides