Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/adr/0007-no-django-bootstrapper.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# No Django bootstrapper

Every bootstrapper keeps one contract: the user constructs the application, passes it in, and gets
the same object back. Django's observability is conventionally owned by `settings.py`
(`MIDDLEWARE` ordering, installed apps), which runs before any object a bootstrapper could be handed.
Every bootstrapper keeps one contract: it takes the user's application, or builds one from config,
instruments it and returns it. FastAPI, FastStream and FastMCP accept an application and build a
default one when none is passed. Litestar always builds its own with `Litestar.from_config` from the
user's `application_config`, because its plugins and middleware must be in the `AppConfig` before the
app exists. Django's observability is conventionally owned by `settings.py` (`MIDDLEWARE` ordering,
installed apps), which runs before any object a bootstrapper could be handed or build.
ADR-0001 is the calibration: FastMCP was the hardest framework to fit and still had an application
object to attach to. Attaching to a constructed `ASGIHandler` is the shape that would fit, and today
that means middleware outside `MIDDLEWARE`, diverging from every Django deployment guide and from
Expand Down
5 changes: 5 additions & 0 deletions docs/integrations/litestar.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ bootstrapper = LitestarBootstrapper(bootstrapper_config)
application = bootstrapper.bootstrap()
```

The bootstrapper builds the `Litestar` app itself with `Litestar.from_config`, so app-level settings
go into `application_config=AppConfig(...)` instead of an `application` argument
([ADR-0007](https://github.com/modern-python/lite-bootstrap/blob/main/docs/adr/0007-no-django-bootstrapper.md)
records why).

Read more about available configuration options [here](../introduction/configuration.md).

## Logging
Expand Down
Loading