Skip to content

Commit 98b283f

Browse files
authored
docs(adr): reword ADR-0007's contract to cover Litestar's application_config (#355)
1 parent fe3dccb commit 98b283f

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎docs/adr/0007-no-django-bootstrapper.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
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.
69
ADR-0001 is the calibration: FastMCP was the hardest framework to fit and still had an application
710
object to attach to. Attaching to a constructed `ASGIHandler` is the shape that would fit, and today
811
that means middleware outside `MIDDLEWARE`, diverging from every Django deployment guide and from

‎docs/integrations/litestar.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ bootstrapper = LitestarBootstrapper(bootstrapper_config)
4545
application = 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+
4853
Read more about available configuration options [here](../introduction/configuration.md).
4954

5055
## Logging

0 commit comments

Comments
 (0)