(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',

修改前

修改后

 

posted @ 2021-03-25 11:44  linhuang  阅读(12)  评论(0)    收藏  举报  来源