python - Django问题 'WSGIRequest' object has no attribute 'user'
ringa_lee
ringa_lee 2017-04-18 10:21:54
0
2
877

当我的django是1.9的时候 我进入/admin会有这个报错
但是当django版本是1.10.2的时候就不会有
请大神解疑惑

ringa_lee
ringa_lee

ringa_lee

reply all(2)
迷茫

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template