#NEWLINE# def logout( request , next_page = None , template_name = 'registration/logged_out.html' , redirect_field_name = REDIRECT_FIELD_NAME ) : #NEWLINE# #INDENT# "Logs out the user and displays 'You are logged out' message." #NEWLINE# from django.contrib.auth import logout #NEWLINE# logout ( request ) #NEWLINE# if ( next_page is None ) : #NEWLINE# #INDENT# redirect_to = request . REQUEST . get ( redirect_field_name , '' ) #NEWLINE# if redirect_to : #NEWLINE# #INDENT# return HttpResponseRedirect ( redirect_to ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return render_to_response ( template_name , { #NEWLINE# #INDENT# 'title' : _ ( 'Logged out' ) , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseRedirect ( ( next_page or request . path ) )