2👍
✅
You have to provide url of login page, so the line should be
return logout_then_login(request,login_url='/login'))
Assuming /login
is your login url, or you can use reverse
with name of your login url in urls.py
Source:stackexchange.com