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',
修改前
修改后