diff --git a/docs/topics/http/middleware.txt b/docs/topics/http/middleware.txt
index 86283af..337290b 100644
a
|
b
|
A middleware can be written as a function that looks like this::
|
28 | 28 | def simple_middleware(get_response): |
29 | 29 | # One-time configuration and initialization. |
30 | 30 | |
31 | | def middleware(request): |
| 31 | def middleware(request, *args, **kwargs): |
32 | 32 | # Code to be executed for each request before |
33 | 33 | # the view (and later middleware) are called. |
34 | 34 | |
35 | | response = get_response(request) |
| 35 | response = get_response(request, *args, **kwargs) |
36 | 36 | |
37 | 37 | # Code to be executed for each request/response after |
38 | 38 | # the view is called. |
… |
… |
Or it can be written as a class whose instances are callable, like this::
|
48 | 48 | self.get_response = get_response |
49 | 49 | # One-time configuration and initialization. |
50 | 50 | |
51 | | def __call__(self, request): |
| 51 | def __call__(self, request, *args, **kwargs): |
52 | 52 | # Code to be executed for each request before |
53 | 53 | # the view (and later middleware) are called. |
54 | 54 | |
55 | | response = self.get_response(request) |
| 55 | response = self.get_response(request, *args, **kwargs) |
56 | 56 | |
57 | 57 | # Code to be executed for each request/response after |
58 | 58 | # the view is called. |