[Django]-Django How to add a logout successful message using the django.contrib.auth?

5👍

You can use user_logged_out signal

from django.contrib.auth.signals import user_logged_out
from django.contrib import messages

def show_message(sender, user, request, **kwargs):
    # whatever...
    messages.info(request, 'You have been logged out.')

user_logged_out.connect(show_message)

Leave a comment