Tried!  But not worked!
I find a solution -

Called url in templete with a form and csrf token.

On Thu, 22 Feb 2024, 9:29 pm Adisa Habeebulah, <adisahabeebu...@gmail.com>
wrote:

> Remove the LOGOUT_REDIRECT_URL from the settings
> That should solve the problem
>
>
> On Thu, Feb 22, 2024, 3:02 PM Okechukwu Ogo <ogookechukwujos...@gmail.com>
> wrote:
>
>> Check your logout URL and view if there's a mistake
>>
>> On Thu, 22 Feb 2024, 14:27 AshiQul Islam Munna, <ashiq.cse.m...@gmail.com>
>> wrote:
>>
>>> Hello!
>>>
>>> I am using default auth system in my project these steps-
>>>
>>> 1. Add this in my project urls path("accounts/", include(
>>> "django.contrib.auth.urls")),
>>>
>>> 2. Create HTML file in  -'templates/registration/login.html'
>>>
>>> 3. In 'base.html' i wrote -
>>> ' {% if user.is_authenticated %}
>>>         <p>Hi {{ user.username }}!</p>
>>>         <p><a href="{% url 'logout' %}">Log out</a></p>
>>>         {% else %}
>>>         <p>You are not logged in.</p>
>>>         <a href="{% url 'login' %}">Log In</a>
>>>         {% endif %}
>>> '
>>>
>>> 4. And finally in 'setting.py' set
>>> LOGIN_REDIRECT_URL = "home"
>>> LOGOUT_REDIRECT_URL = "home"
>>>
>>> That's ALL!
>>> ' LOGIN ' works perfectly but "LOGOUT " not working. It say's-
>>> [image: Screenshot_96.png]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/c94cea9b-59be-41f3-ae1b-2a7c64156e8fn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/c94cea9b-59be-41f3-ae1b-2a7c64156e8fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMeYHes6XEoGcHAgLQqgXMPLwkU9dh%2BbV3k0vPcVGU8MEAZGuw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMeYHes6XEoGcHAgLQqgXMPLwkU9dh%2BbV3k0vPcVGU8MEAZGuw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/v2T9gA87vmA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF0%2B-3nghV_jj93v7yHwFuUKp4hfFDjMCNMUyWR1AyZbie6NxA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF0%2B-3nghV_jj93v7yHwFuUKp4hfFDjMCNMUyWR1AyZbie6NxA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH%3DY28p-fNK6_6x398it5FsN4QTZXqEO6GJSvwU3shQs5Kkw0w%40mail.gmail.com.

Reply via email to