q0987
q0987

Reputation: 35982

How to let the user know that they have logout in django?

I have used the following code snippet to logout the user from the session.

from django.http import HttpResponseRedirect
from django.contrib.auth import logout

def logout_page(request):
   logout(request)
   return HttpResponseRedirect('/')

Question> I need to notify the user that he/she has successfully logout. How can I do that in django?

Thank you

Upvotes: 0

Views: 100

Answers (1)

second
second

Reputation: 28637

i guess you could redirect them to a thanks for logging out page instead of /

you may also want to have a look at the messages framework

Upvotes: 4

Related Questions