#NEWLINE# def render_to_response( self , context , **response_kwargs ) : #NEWLINE# #INDENT# def indent( s ) : #NEWLINE# #INDENT# return s . replace ( '\n' , '\n  ' ) #NEWLINE# #UNINDENT# template = Engine ( ) . from_string ( js_catalog_template ) #NEWLINE# context [ 'catalog_str' ] = ( indent ( json . dumps ( context [ 'catalog' ] , sort_keys = True , indent = 2 ) ) if context [ 'catalog' ] else None ) #NEWLINE# context [ 'formats_str' ] = indent ( json . dumps ( context [ 'formats' ] , sort_keys = True , indent = 2 ) ) #NEWLINE# return http . HttpResponse ( template . render ( Context ( context ) ) , 'text/javascript' )