Incorrectly ordered middleware can stop the middleware working as intended.
The order of middleware affections the outcome.
Some middleware should be near the end of the middleware list to ensure it is one of the last to be called.
For example RedirectFallbackMiddleware and FlatpageFallbackMiddleware should be near the end.
If we spot this issue in your GitHub pull request we give this advice:
Incorrectly ordered middleware can stop the middleware working as intended.Read more
Configuring this check
Django Doctor will run this check by default. No configuration is needed but the check can be turned on/off using check code Read more about configuring Django Doctor.
middleware-order-end in your pyproject.toml file.