mirror of https://github.com/encode/starlette.git
Document the `request.app` property.
* Mention it in the Request documentation * Mention it in the Application documentation in the context of accessing the application state
This commit is contained in:
parent
ce2883e28d
commit
0e75f9f2b8
|
@ -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:
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue