(admin.E408)(admin.E409)(admin.E410)must be in MIDDLEWARE in order to use the admin application

Django在运行登录时报错,报错信息如下

ERRORS:
?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware' must be in MIDDLEWARE in order to use the admin application.

System check identified 3 issues (0 silenced).

找到对应的app下的settings.py中

1.将 MIDDLEWARE_CLASSES 改为 MIDDLEWARE  。

2.删除 'django,contrib.auth.middleware.SessionAuthenticationMiddleware',

修改前

(admin.E408)(admin.E409)(admin.E410)must be in MIDDLEWARE in order to use the admin application

修改后

(admin.E408)(admin.E409)(admin.E410)must be in MIDDLEWARE in order to use the admin application

 

上一篇:Asp.net MVC + EF + Spring.Net 项目实践(二)


下一篇:Linux超级干货-安装Django与注意事项