Edit:
TempMiddleware not TempMiddleware . This is the name of the class, you must put the entire import path.
eg:
'django.contrib.auth.middleware.AuthenticationMiddleware'
but not
'AuthenticationMiddleware'
So, if your class is in app_name / middleware.py, it should be
app_name.middlaware.TempMiddleware
It just means that in your settings file, the MIDDLEWARE_CLASSES variable contains a list of modules in which one of the listed modules is not middleware.
Possible reasons:
- You have added middleware that does not declare middleware methods: fix this by deleting the last middleware added.
- you added the correct middleware, but forgot to put someone at the end of the name, so the lines are merged, and that does django, thinks that 2 middlewares are actually one: fix it by adding the missing to
source share