From e94243aa74e7a77fb6457e02f6f4201b3f063b96 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Fri, 10 Oct 2014 20:21:25 +0200 Subject: Make the template directory configurable Signed-off-by: Patrick Uiterwijk Reviewed-by: Simo Sorce --- ipsilon/ipsilon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipsilon') diff --git a/ipsilon/ipsilon b/ipsilon/ipsilon index 9700106..681600d 100755 --- a/ipsilon/ipsilon +++ b/ipsilon/ipsilon @@ -60,7 +60,11 @@ admin_config = datastore.load_config() for option in admin_config: cherrypy.config[option] = admin_config[option] -templates = os.path.join(cherrypy.config['base.dir'], 'templates') +template_dir = cherrypy.config.get('template_dir', 'templates') +if template_dir.startswith('/'): + templates = template_dir +else: + templates = os.path.join(cherrypy.config['base.dir'], template_dir) template_env = Environment(loader=FileSystemLoader(templates)) if __name__ == "__main__": -- cgit