S
S
Sergey Nizhny Novgorod2019-01-19 12:13:24
Django
Sergey Nizhny Novgorod, 2019-01-19 12:13:24

Django admin and login stopped working after update?

Hello everyone
I updated django to version 2xx, authorization and admin panel stopped working
___ I get an
error:

AttributeError at /gates/
'WSGIRequest' object has no attribute 'user'

Request Method:	GET
Request URL:	http://site.ru/gates/
Django Version:	2.0.10
Exception Type:	AttributeError
Exception Value:	
'WSGIRequest' object has no attribute 'user'
Exception Location:	/home/site/proxy/djangoen/lib/python3.4/site-packages/django/contrib/admin/sites.py in has_permission, line 186
Python Executable:	/home/site/proxy/djangoen/bin/python3.4

__
Most of the comments on the network are related to middleware, but I don’t understand what exactly is needed (because I already have it right)
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',
  'django.contrib.redirects.middleware.RedirectFallbackMiddleware' #редиректы
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sergeev, 2019-01-20
@Terras

https://m.habr.com/en/post/417837/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question