MIDDLEWARE_CLASSES order
 

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?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
esse's avatar
23
esse
asked 12 years ago

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's avatar esse (12 years ago)
see more comments