# Logged out redirection

**URL:** <https://forum.djangoproject.com/t/logged-out-redirection/30401>\
**Category:** Getting Started\
**Created:** [April 22, 2024, 3:02am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401 "2024-04-22T03:02:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [April 22, 2024, 3:02am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/1 "2024-04-22T03:02:57Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 22, 2024, 3:24am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/2 "2024-04-22T03:24:27Z")

</div>

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/`?)

---

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [April 22, 2024, 3:47am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/3 "2024-04-22T03:47:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 22, 2024, 3:54am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/4 "2024-04-22T03:54:34Z")

</div>

You do get redirected to ‘login/’

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

---

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [April 22, 2024, 4:06am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/5 "2024-04-22T04:06:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 22, 2024, 4:13am UTC](https://forum.djangoproject.com/t/logged-out-redirection/30401/6 "2024-04-22T04:13:19Z")

</div>

Yes, and what page does that show you?
