Can anyone clarify how to order below middleware classes?
'mediagenerator.middleware.MediaMiddleware',
'autoload.middleware.AutoloadMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
.
.
.
'django.middleware.cache.FetchFromCacheMiddleware',
'google.appengine.ext.appstats.recording.AppStatsDjangoMiddleware',
In documents, every middleware in the top group is told to come first, and both middleware in the bottom group is told to come last. This is confusing. Below is the whole list of middleware that I'm using:
'mediagenerator.middleware.MediaMiddleware',
'autoload.middleware.AutoloadMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.csrf.middleware.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'google.appengine.ext.appstats.recording.AppStatsDjangoMiddleware',
Any help and explanation will be appreciated.
Please check if everything is working:
'autoload.middleware.AutoloadMiddleware', # This is loading other modules, so it goes first because we want everything set before processing.
'mediagenerator.middleware.MediaMiddleware', # Serves/caches static files with urls starting with DEV_MEDIA_URL
'django.middleware.cache.UpdateCacheMiddleware', # Must be before other middleware that changes the header, so it seems that the right place for this is here
'google.appengine.ext.appstats.recording.AppStatsDjangoMiddleware', # Must be 'first' too. It collects stats of all middlewares below this. If you want stats from the middlewares above move it to the top
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.csrf.middleware.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',