django logout user session code example
Example 1: how to logout in django
from django.contrib.auth import logout
def logout_view(request):
logout(request)
# Redirect to a success page.
Example 2: django logout user
def logout_request(request):
logout(request)
return redirect("")