diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-05-03 19:27:28 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-05-05 19:04:32 +0300 |
| commit | 445fe50c6bec016724da97cd3f8c35535e02c3a8 (patch) | |
| tree | ee0d273eae89c7f60a5f24f4c3d9e79fadb06a93 | |
| parent | 4b77ba7125e202f112349901dd621ce287e4ad8f (diff) | |
rz_config: template.d_path
| -rw-r--r-- | res/etc/rhizi-server.conf.example | 4 | ||||
| -rw-r--r-- | res/rz-mux/rhizi-conf-template.d/rhizi-server.conf.jinja | 1 | ||||
| -rw-r--r-- | src/local/rz-mux/rz-mux-tool.py | 1 | ||||
| -rw-r--r-- | src/server/rz_server.py | 4 |
4 files changed, 8 insertions, 2 deletions
diff --git a/res/etc/rhizi-server.conf.example b/res/etc/rhizi-server.conf.example index c5c14532..09eb9b7f 100644 --- a/res/etc/rhizi-server.conf.example +++ b/res/etc/rhizi-server.conf.example @@ -7,8 +7,10 @@ # ----------------------------------------------------------------------------- # General # +#root_path = +#template.d_path + development_mode = True -#root_path = . static_url_path = /static # ----------------------------------------------------------------------------- diff --git a/res/rz-mux/rhizi-conf-template.d/rhizi-server.conf.jinja b/res/rz-mux/rhizi-conf-template.d/rhizi-server.conf.jinja index e36fec9f..f6a234cd 100644 --- a/res/rz-mux/rhizi-conf-template.d/rhizi-server.conf.jinja +++ b/res/rz-mux/rhizi-conf-template.d/rhizi-server.conf.jinja @@ -8,6 +8,7 @@ # General # root_path = {{ root_path }} +template.d_path = {{ template_d_path }} development_mode = True static_url_path = /static diff --git a/src/local/rz-mux/rz-mux-tool.py b/src/local/rz-mux/rz-mux-tool.py index 18e2cf44..802d0d02 100644 --- a/src/local/rz-mux/rz-mux-tool.py +++ b/src/local/rz-mux/rz-mux-tool.py @@ -84,6 +84,7 @@ def gen_dom_config__rhizi(domain_fqdn, port_map): 'rz_port__http': port_map.rz_port__http, 'rz_server_secret': rz_server_secret, 'user_db_path': user_db_path, + 'template_d_path': '/srv/www/rhizi/mux-root.d/%s/webapp/fragment.d/template.d' % (domain_fqdn), }), Template_Task(os.path.join(rz_template_path_prefix, 'rhizi.init.jinja'), os.path.join(install_prefix, 'etc/init.d/', 'rhizi__%s' % (domain_fqdn)), diff --git a/src/server/rz_server.py b/src/server/rz_server.py index 0ddad61c..756eb1d9 100644 --- a/src/server/rz_server.py +++ b/src/server/rz_server.py @@ -40,6 +40,7 @@ class Config(object): neo4j_url root_path: root path from which the server will serve content user_db_path: absolute path to a Berkeley DB file used to store user accounts & password hash values + template.d_path: absolute path to the jinja HTML template dir """ @staticmethod @@ -49,6 +50,7 @@ class Config(object): cfg['development_mode'] = False cfg['root_path'] = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + cfg['template.d_path'] = os.path.join(cfg['root_path'], 'template.d') cfg['user_db_path'] = './user_db.db' @@ -412,7 +414,7 @@ def init_webapp(cfg, kernel): # webapp = FlaskExt(__name__, static_folder='static', - template_folder=os.path.join(root_path, 'templates'), + template_folder=cfg.template_folder, static_url_path=cfg.static_url_path) webapp.config.from_object(cfg) webapp.root_path = root_path # for some reason calling config.from_xxx() does not have effect |
