File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# No Django bootstrapper
22
3- Every bootstrapper keeps one contract: the user constructs the application, passes it in, and gets
4- the same object back. Django's observability is conventionally owned by ` settings.py `
5- (` MIDDLEWARE ` ordering, installed apps), which runs before any object a bootstrapper could be handed.
3+ Every bootstrapper keeps one contract: it takes the user's application, or builds one from config,
4+ instruments it and returns it. FastAPI, FastStream and FastMCP accept an application and build a
5+ default one when none is passed. Litestar always builds its own with ` Litestar.from_config ` from the
6+ user's ` application_config ` , because its plugins and middleware must be in the ` AppConfig ` before the
7+ app exists. Django's observability is conventionally owned by ` settings.py ` (` MIDDLEWARE ` ordering,
8+ installed apps), which runs before any object a bootstrapper could be handed or build.
69ADR-0001 is the calibration: FastMCP was the hardest framework to fit and still had an application
710object to attach to. Attaching to a constructed ` ASGIHandler ` is the shape that would fit, and today
811that means middleware outside ` MIDDLEWARE ` , diverging from every Django deployment guide and from
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ bootstrapper = LitestarBootstrapper(bootstrapper_config)
4545application = bootstrapper.bootstrap()
4646```
4747
48+ The bootstrapper builds the ` Litestar ` app itself with ` Litestar.from_config ` , so app-level settings
49+ go into ` application_config=AppConfig(...) ` instead of an ` application ` argument
50+ ([ ADR-0007] ( https://github.com/modern-python/lite-bootstrap/blob/main/docs/adr/0007-no-django-bootstrapper.md )
51+ records why).
52+
4853Read more about available configuration options [ here] ( ../introduction/configuration.md ) .
4954
5055## Logging
You can’t perform that action at this time.
0 commit comments