Skip to content

Commit 8ab69ad

Browse files
committed
update middleware docs formatting
1 parent f7ec20c commit 8ab69ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/middleware/base.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ with the following specification:
1010
>>> middleware = AsyncMiddlewareMixin(get_response)
1111
>>> await middleware()
1212
```
13-
where `get_response` is an async function, sync functions are not supported and will raise an error.
13+
where `get_response` is an **async function**, sync functions are not supported and **will raise** an error.
1414

1515
----------------------------
1616

1717
other methods are as follows:
1818

19-
* `process_request` and `process_response` are `await`ed inside the middleware and have to be async
19+
* `process_request` and `process_response` are `await`ed inside the middleware and **have to be async**.
2020

2121
* `process_view` and `process_template_response` can be either sync or async, but **async is preferred**, if it's sync django will wrap it as async which might have slight performance reduction.
2222

2323
* `process_exception` can be either sync or async, but **sync is preferred**, if async is used django wraps the method to be called synchronously.
24+

0 commit comments

Comments
 (0)