#NEWLINE# def create_config( ) : #NEWLINE# #INDENT# dirpath = path . join ( settings . STATIC_ROOT , settings . JS_CACHE_DIR ) #NEWLINE# filepath = path . join ( settings . STATIC_ROOT , settings . JS_CACHE_DIR , 'config.js' ) #NEWLINE# tmpl = loader . get_template ( 'splunkdj:config.html' ) #NEWLINE# ctx = Context ( { #NEWLINE# #INDENT# 'config' : json . dumps ( settings . CLIENT_CONFIG ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# rendered = tmpl . render ( ctx ) #NEWLINE# if ( not path . exists ( dirpath ) ) : #NEWLINE# #INDENT# makedirs ( dirpath ) #NEWLINE# #UNINDENT# output_file = open ( filepath , 'w' ) #NEWLINE# output_file . write ( rendered ) #NEWLINE# output_file . flush ( ) #NEWLINE# output_file . close ( )