Skip to content

Commit e7fa022

Browse files
committed
document async locale middleware
1 parent 37043c6 commit e7fa022

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AsyncLocaleMiddleware
2+
3+
it works exactly like django's [LocaleMiddleware](https://docs.djangoproject.com/en/5.1/ref/middleware/#module-django.middleware.locale)
4+
except that it's fully async
5+
read django's [Internationalization](https://docs.djangoproject.com/en/5.1/topics/i18n/translation/) documentations for a more in depth look.
6+
7+
### Usage:
8+
remove django's `django.middleware.locale.LocaleMiddleware` from the `MIDDLEWARE` setting and add
9+
`django_async_extensions.middleware.locale.AsyncLocaleMiddleware` in it's place.
10+
11+
**note**: this middleware like other middlewares provided in this package can work alongside sync middlewares, and can handle sync views.

0 commit comments

Comments
 (0)