django return error if not authenticated code example
Example 1: django admin password reset
python manage.py changepassword <user_name>
Example 2: how to logout in django
from django.contrib.auth import logout
def logout_view(request):
logout(request)
# Redirect to a success page.