1 from django.contrib.auth import logout
2 from django.http import HttpResponseRedirect
4 from myslice.settings import logger
8 # hard question : where should we redirect requests to logout if user is not logged in ?
9 def logout_user (request):
10 # check that we're indeed logged in
11 if not request.user.is_authenticated():
12 return HttpResponseRedirect ('/')
13 logger.info("LOGGING OUT")
16 activity.user.logout(request)
19 return HttpResponseRedirect ('/')