Uninett/nav
Update all homemade middleware to be compatible with Django 4.1
Open
#2,468 opened on Aug 19, 2022
djangogood first issuetask
Repository metrics
- Stars
- (224 stars)
- PR merge metrics
- (PR metrics pending)
Description
Django 4.1 can run asynchronously, old-style middlewares need to be adapted in order to not trigger an exception complaining that the attribute _is_coroutine is missing.
It might not be necessary to stop inheriting from MiddlewareMixin and add a __call__-method since most of Django's own middlewares still (as of 2025-10-30, main branch) inherits from MiddlewareMixin. (Exception: RemoteUserMiddleware, and there's no reason for it not to.)