Skip to content

Commit 0823160

Browse files
committed
document async common middlewares
1 parent 813fbc6 commit 0823160

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/middleware/common_middlewares.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Common Middlewares
2+
3+
## AsyncCommonMiddleware
4+
it works exactly like django's [CommonMiddleware](https://docs.djangoproject.com/en/5.1/ref/middleware/#django.middleware.common.CommonMiddleware)
5+
except that it's fully async
6+
7+
### Usage:
8+
remove django's `django.middleware.common.CommonMiddleware` from the `MIDDLEWARE` setting and add
9+
`django_async_extensions.middleware.common.AsyncCommonMiddleware` in it's place.
10+
11+
12+
13+
## AsyncBrokenLinkEmailsMiddleware
14+
it works exactly like django's [BrokenLinkEmailsMiddleware](https://docs.djangoproject.com/en/5.1/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware)
15+
except that it's fully async
16+
17+
### Usage:
18+
remove django's `django.middleware.common.LinkEmailsMiddleware` from the `MIDDLEWARE` setting if it's in there and add
19+
`django_async_extensions.middleware.common.AsyncBrokenLinkEmailsMiddleware` in it's place.
20+
21+
22+
**note**: these two middlewares like other middlewares provided in this package can work alongside sync middlewares, and can handle sync views.

0 commit comments

Comments
 (0)