MIDDLEWARE_CLASSES order

asked 2012-11-21 00:17:14 -0500

esse gravatar image

I noticed that the order recommended by askbot for MIDDLEWARE_CLASSES has:

'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',

whereas django documentation and default settings has:

 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',

If i change the order to match what Django recommends it takes the site down ... the ordering of middle ware always confuses me a bit, but I am wondering why the difference and if it has any side effects for other functioning?

edit retag flag offensive close merge delete

Comments

I have been reading the Django documentation lately and I notice that sometimes they have the SessionsMiddleware before CommonMiddleware, despite their documentation that I linked to. Still not 100% sure about it all.

esse gravatar imageesse ( 2012-11-22 22:51:40 -0500 )edit