David Leonard 10 년 전
부모
커밋
191b037619
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      hackathon_starter/hackathon/views.py

+ 7 - 0
hackathon_starter/hackathon/views.py

@@ -93,3 +93,10 @@ def user_login(request):
         # No context variables to pass to the template system, hence the
         # blank dictionary object...
         return render(request, 'hackathon/login.html', {})
+
+def user_logout(request):
+    # Since we know the user is logged in, we can now just log them out.
+    logout(request)
+
+    # Take the user back to the homepage.
+    return HttpResponseRedirect('/hackathon/')