Logged out redirection

If I press Enter using http://127.0.0.1:8000/dashboard/ after logged out I am redirecting to http://127.0.0.1:8000/login/?next=/dashboard/.

How can I redirect to http://127.0.0.1:8000/login/ after logged out by press Enter ?

Why do you want to?

Your browser has requested the url dashboard/.

However, you’re not currently logged in, so you need to log in before you can go to dashboard/

So, Django redirects you to login/, but will then send you to dashboard/ after you’ve been logged in.

(What mechanism are you using to protect the dashboard/ view? What do you have configured to have it redirect to login/?)

1 Like

Thanks @KenWhitesell . Actually I would like to browse http://127.0.0.1:8000/dashboard/ after logged out. I need to redirect to http://127.0.0.1:8000/login/ if I try to browse http://127.0.0.1:8000/dashboard/ after logged out. Thanks.

You do get redirected to ‘login/’

That’s why I don’t understand the reason for your question.

1 Like

Thanks @KenWhitesell . It is redirecting to http://127.0.0.1:8000/login/?next=/dashboard/ if I try to browse http://127.0.0.1:8000/dashboard/ after logged out.

Yes, and what page does that show you?

1 Like