This is a problem with the Django version. Before 1.9, the middleware key is MIDDLEWARE_CLASSES, and after 1.9, it is MIDDLEWARE. Therefore, when the versions of the development environment and other environments are inconsistent, be particularly careful as there may be pitfalls.
You need to change MIDDLEWARE to MIDDLEWARE_CLASSES in settings
Generally when an error is reported saying that an object lacks a certain attribute, it is very likely that the object is actually None. I don’t know the specific situation here.
This is a problem with the Django version. Before 1.9, the middleware key is MIDDLEWARE_CLASSES, and after 1.9, it is MIDDLEWARE. Therefore, when the versions of the development environment and other environments are inconsistent, be particularly careful as there may be pitfalls.
You need to change MIDDLEWARE to MIDDLEWARE_CLASSES in settings
Generally when an error is reported saying that an object lacks a certain attribute, it is very likely that the object is actually None. I don’t know the specific situation here.