#NEWLINE# def process_response( self , request , response ) : #NEWLINE# #INDENT# if ( response . status_code != 404 ) : #NEWLINE# #INDENT# return protect_render #NEWLINE# #UNINDENT# template = '{0}/{1}.html' . format ( SIMPLE_TEMPLATES_DIR , ( request . path . strip ( '/' ) or '_homepage_' ) ) #NEWLINE# if ( not find_template ( template ) ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# if ( ( not request . path . endswith ( '/' ) ) and settings . APPEND_SLASH ) : #NEWLINE# #INDENT# url = ( request . path + '/' ) #NEWLINE# qs = request . META . get ( 'QUERY_STRING' ) #NEWLINE# if qs : #NEWLINE# #INDENT# url += ( '?' + qs ) #NEWLINE# #UNINDENT# return redirect ( url , permanent = True ) #NEWLINE# #UNINDENT# @ requires_csrf_token #NEWLINE# def protect_render( request ) : #NEWLINE# #INDENT# return render ( request , get_ab_template ( request , template ) ) #NEWLINE# #UNINDENT# return protect_render ( request )