diff --git a/docs/applications.md b/docs/applications.md index e19928f5..5c30365f 100644 --- a/docs/applications.md +++ b/docs/applications.md @@ -80,7 +80,7 @@ exceptions that occur within the application: ### Storing state on the app instance You can store arbitrary extra state on the application instance, using the -generic `app.state` attribute. +generic `app.state` attribute. This can then be accessed in middleware or endpoints via `request.app`. For example: diff --git a/docs/requests.md b/docs/requests.md index 5c9caa61..f0ffc66b 100644 --- a/docs/requests.md +++ b/docs/requests.md @@ -140,6 +140,10 @@ filename = form["upload_file"].filename contents = await form["upload_file"].read() ``` +#### Application + +The originating Starlette application can be accessed via `request.app`. + #### Other state If you want to store additional information on the request you can do so