Titivillus/logout/views.py

16 lines
307 B
Python
Raw Permalink Normal View History

2018-08-10 18:57:28 -04:00
#!/usr/bin/env python3
"""
/logout app views.
"""
from django.contrib import messages
from django.shortcuts import redirect
from django.contrib.auth import logout
def index(request):
"""
Logs the user out.
"""
logout(request)
messages.success(request, "Logged out")
return redirect('homepage:index')