There was no workaround written in Japanese, so I will write it down.
In the application created with Django, when creating a User and logging in as that user, the following error occurs.
You have multiple authentication backends configured
and therefore must provide the `backend` argument or
set the `backend` attribute on the user.
Even though multiple AUTHENTICATION_BACKENDS were used, backend was not specified in the login process.
views.py
#User registration screen
#Login process
login(self.request, user) #Error here
settings.py
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', # ID/pass
'allauth.account.auth_backends.AuthenticationBackend', #social
)
I specified backend.
views.py
#User registration screen
#Login process
login(self.request, user, backend='django.contrib.auth.backends.ModelBackend')
solved. You had to specify the backend.
Recommended Posts