Description

See the topic, ​How Django Discovers Language Preference. There is box that shows an example of where to locate the LocaleMiddleware, properly following SessionMiddleware, but listing CommonMiddleware last.

In the ​middleware documentation, CommonMiddleware is shown listed first. Is there any reason why CommonMiddleware must come first or last in either of these cases?

A note clarifying any dependencies or documenting that there are no dependencies might be helpful.

Oldest firstNewest firstThreaded

Show commentsShow property changes

Change History (2)

There's no reason that CommonMiddleware should go first or last. Like most middlewares, it has no dependencies, which is why the middleware documentation doesn't mention any. There are only a couple of middlewares that are order specific - LocaleMiddleware being one of them.