From 87ab9d7524c17b3e03184d9ca54bd883fe1c97ad 2013-08-16 17:37:41 From: MinRK Date: 2013-08-16 17:37:41 Subject: [PATCH] Backport PR #4035: Fixed custom jinja2 templates being ignored when setting template_path IPython/html/notebookapp.py was ignoring user specified templates by setting the jinja2 environment to the default template directory before updating template_path. This fix allows a user defined template_path to propagate to the jinja2 environment. --- diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 9e26111..08b4f58 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -149,7 +149,7 @@ class NotebookWebApplication(web.Application): # Note that the URLs these patterns check against are escaped, # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'. base_project_url = py3compat.unicode_to_str(base_project_url, 'ascii') - template_path = os.path.join(os.path.dirname(__file__), "templates") + template_path = settings_overrides.get("template_path", os.path.join(os.path.dirname(__file__), "templates")) settings = dict( # basics base_project_url=base_project_url,