[Answered ]-Second Django Logout Does Not Work

2👍

return redirect('login_view', permanent = True)

You are using permanent redirects in your login and logout views. This means that your browser goes straight to the target page, so the server does not log the user in or out.

Even after you remove permanent = True, your browser may store the permanent redirect. You can test your code is workibg by using another browser.

Django comes with login and logout views. I suggest you use them to avoid this mistake or others.

Leave a comment