Create and return an app context. This is best used within a context, i.e. .. code-block:: python async with app.app_context(): ...
(self)
| 1247 | ) |
| 1248 | |
| 1249 | def app_context(self) -> AppContext: |
| 1250 | """Create and return an app context. |
| 1251 | |
| 1252 | This is best used within a context, i.e. |
| 1253 | |
| 1254 | .. code-block:: python |
| 1255 | |
| 1256 | async with app.app_context(): |
| 1257 | ... |
| 1258 | """ |
| 1259 | return AppContext(self) |
| 1260 | |
| 1261 | def request_context(self, request: Request) -> RequestContext: |
| 1262 | """Create and return a request context. |