##// END OF EJS Templates
Modified initial template_path to pickup any overridden value by the user
Matt Henderson -
Show More
@@ -149,7 +149,7 b' class NotebookWebApplication(web.Application):'
149 # Note that the URLs these patterns check against are escaped,
149 # Note that the URLs these patterns check against are escaped,
150 # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'.
150 # and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'.
151 base_project_url = py3compat.unicode_to_str(base_project_url, 'ascii')
151 base_project_url = py3compat.unicode_to_str(base_project_url, 'ascii')
152 template_path = os.path.join(os.path.dirname(__file__), "templates")
152 template_path = settings_overrides.get("template_path", os.path.join(os.path.dirname(__file__), "templates"))
153 settings = dict(
153 settings = dict(
154 # basics
154 # basics
155 base_project_url=base_project_url,
155 base_project_url=base_project_url,
@@ -172,15 +172,12 b' class NotebookWebApplication(web.Application):'
172 # IPython stuff
172 # IPython stuff
173 mathjax_url=ipython_app.mathjax_url,
173 mathjax_url=ipython_app.mathjax_url,
174 config=ipython_app.config,
174 config=ipython_app.config,
175 use_less=ipython_app.use_less
175 use_less=ipython_app.use_less,
176 jinja2_env=Environment(loader=FileSystemLoader(template_path))
176 )
177 )
177
178
178 # allow custom overrides for the tornado web app.
179 # allow custom overrides for the tornado web app.
179 settings.update(settings_overrides)
180 settings.update(settings_overrides)
180
181 # create a jinja2 environment using the template path and store it in settings
182 settings["jinja2_env"]=Environment(loader=FileSystemLoader(settings["template_path"]))
183
184 return settings
181 return settings
185
182
186 def init_handlers(self, settings):
183 def init_handlers(self, settings):
General Comments 0
You need to be logged in to leave comments. Login now