#NEWLINE# def direct_to_template( request , template , extra_context = None , **kwargs ) : #NEWLINE# #INDENT# "\n    Replacement for Django's ``direct_to_template`` that uses\n    ``TemplateResponse`` via ``mezzanine.utils.views.render``.\n    " #NEWLINE# context = ( extra_context or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# context [ 'params' ] = kwargs #NEWLINE# for ( key , value ) in context . items ( ) : #NEWLINE# #INDENT# if callable ( value ) : #NEWLINE# #INDENT# context [ key ] = value ( ) #NEWLINE# #UNINDENT# #UNINDENT# return TemplateResponse ( extra_context , template , context )