' WSGIRequest'对象没有属性' session'和'用户'

时间:2018-04-28 10:13:43

标签: python django

我的项目中间设置失败:

enter image description here

我已检查过如上所示的请求,但它不包含用户和会话。我不知道问题出在哪里。

你能给我一些建议吗?

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

0 个答案:

没有答案