#NEWLINE# def logout( request , next_page = None , template_name = 'registration/logged_out.html' , redirect_field_name = REDIRECT_FIELD_NAME , current_app = None , extra_context = None ) : #NEWLINE# #INDENT# "\n    Logs out the user and displays 'You are logged out' message.\n    " #NEWLINE# auth_logout ( request ) #NEWLINE# redirect_to = request . REQUEST . get ( redirect_field_name , '' ) #NEWLINE# if redirect_to : #NEWLINE# #INDENT# netloc = urlparse . urlparse ( redirect_to ) [ 1 ] #NEWLINE# if ( not ( netloc and ( netloc != request . get_host ( ) ) ) ) : #NEWLINE# #INDENT# return HttpResponseRedirect ( redirect_to ) #NEWLINE# #UNINDENT# #UNINDENT# if ( next_page is None ) : #NEWLINE# #INDENT# current_site = get_current_site ( request ) #NEWLINE# context = { #NEWLINE# #INDENT# 'site' : current_site , #NEWLINE# 'site_name' : current_site . name , #NEWLINE# 'title' : _ ( 'Logged out' ) , #NEWLINE# #UNINDENT# } #NEWLINE# context . update ( ( extra_context or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# return render_to_response ( template_name , context , context_instance = RequestContext ( request , current_app = current_app ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseRedirect ( ( next_page or request . path ) )