FYI, you might be interested in reading Django 1.7 Middleware Ordering . It explains the implications of ordering middleware, and I think it still applies to previous versions of Django.
Ordering middleware Here are some tips on ordering various Django middleware classes:
UpdateCacheMiddleware
Before that change the Vary header (SessionMiddleware, GZipMiddleware, LocaleMiddleware).
Gzipmiddleware
Before any middleware that can modify or use the response body.
After UpdateCacheMiddleware: changes the Vary header.
ConditionalGetMiddleware
Before CommonMiddleware: uses the Etag header when USE_ETAGS = True.
SessionMiddleware
After UpdateCacheMiddleware: changes the Vary header.
Localemiddleware
One of the top ones, after SessionMiddleware (uses session data) and CacheMiddleware (changes the Vary header).
CommonMiddleware
Before any middleware that can change the answer (it calculates ETags).
After GZipMiddleware, therefore, it will not calculate the ETag header on the gzipped content.
Close to the beginning: it redirects when APPEND_SLASH or PREPEND_WWW set to True.
Updates (as indicated by OP in the comments)
The corresponding change looks like Enabled locale middleware by default .
In the comments from this commit:
+ .. versionchanged :: 1.6 + In previous versions of LocaleMiddleware` wasn't enabled by default. + +Because middleware order matters, you should follow these guidelines: * Make sure it one of the first middlewares installed. * It should come after LocaleMiddleware` wasn't enabled by default. + +Because middleware order matters, you should follow these guidelines: * Make sure it one of the first middlewares installed. * It should come after LocaleMiddleware` wasn't enabled by default. + +Because middleware order matters, you should follow these guidelines: * Make sure it one of the first middlewares installed. * It should come after SessionMiddleware , because LocaleMiddleware makes use of session data. And it should come before makes use of session data. And it should come before CommonMiddleware because CommonMiddleware needs an activated language in order to resolve the requested URL. * If you use needs an activated language in order to resolve the requested URL. * If you use CacheMiddleware , put LocaleMiddleware` after it.
Thus, in fact, a new change in the ordering is to allow local use of LocaleMiddleWare by default. You do not need to change these orders in previous versions of Django , since it is not enabled by default.
Update
LocaleMiddleware been removed from the project template.