当我的django是1.9的时候 我进入/admin会有这个报错
但是当django版本是1.10.2的时候就不会有
请大神解疑惑
迷茫2017-04-18 10:23:54
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
黄舟2017-04-18 10:23:54
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.