# HG changeset patch # User Daniel Dourvaris # Date 2016-06-06 13:38:09 # Node ID 967dd702924e36922cdac351f6b94f84112492bd # Parent 09af6d74033d6d143f6151ba59d1a8ce2b2a7422 javascript: use separate ini config for generating dynamic js files diff --git a/configs/development.ini b/configs/development.ini --- a/configs/development.ini +++ b/configs/development.ini @@ -119,6 +119,9 @@ full_stack = true ## Serve static files via RhodeCode, disable to serve them via HTTP server static_files = true +# autogenerate javascript routes file on startup +generate_js_files = false + ## Optional Languages ## en(default), be, de, es, fr, it, ja, pl, pt, ru, zh lang = en @@ -379,7 +382,6 @@ beaker.session.auto = false search.module = rhodecode.lib.index.whoosh search.location = %(here)s/data/index - ################################### ## APPENLIGHT CONFIG ## ################################### diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -82,7 +82,7 @@ def load_environment(global_conf, app_co config['routes.map'] = make_map(config) - if asbool(config['debug']): + if asbool(config['generate_js_files']): jsroutes = config['routes.map'].jsroutes() jsroutes_file_content = generate_jsroutes_content(jsroutes) jsroutes_file_path = os.path.join( diff --git a/rhodecode/config/jsroutes.py b/rhodecode/config/jsroutes.py --- a/rhodecode/config/jsroutes.py +++ b/rhodecode/config/jsroutes.py @@ -29,7 +29,8 @@ def generate_jsroutes_content(jsroutes): * DO NOT CHANGE THIS FILE MANUALLY * * * * * - * This file is automatically generated when the app starts up. * + * This file is automatically generated when the app starts up with * + * generate_js_files = true * * * * To add a route here pass jsroute=True to the route definition in the app * * *