在我的Django网站中出现SystemCheckError,为什么会出现这些中间件错误?

时间:2020-07-25 11:05:20

标签: django django-models middleware django-middleware

所以我试图在Django中运行网页,而django检查所有内容时却出现了这些错误:

SystemCheckError: System check identified some issues:

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.

我查看了Settings文件,一切似乎都正确,django所说的那些软件包都在MIDDLEWARE部分中。

MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

有人知道为什么会这样吗?非常感谢帮助

1 个答案:

答案 0 :(得分:0)

MIDDLEWARE_CLASSES重命名为MIDDLEWARE