mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Modified initial template_path to pickup any overridden value by the user
This commit is contained in:
parent
918d872f2c
commit
af03eb6d1b
@ -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,
|
||||
@ -172,15 +172,12 @@ class NotebookWebApplication(web.Application):
|
||||
# IPython stuff
|
||||
mathjax_url=ipython_app.mathjax_url,
|
||||
config=ipython_app.config,
|
||||
use_less=ipython_app.use_less
|
||||
use_less=ipython_app.use_less,
|
||||
jinja2_env=Environment(loader=FileSystemLoader(template_path))
|
||||
)
|
||||
|
||||
# allow custom overrides for the tornado web app.
|
||||
settings.update(settings_overrides)
|
||||
|
||||
# create a jinja2 environment using the template path and store it in settings
|
||||
settings["jinja2_env"]=Environment(loader=FileSystemLoader(settings["template_path"]))
|
||||
|
||||
return settings
|
||||
|
||||
def init_handlers(self, settings):
|
||||
|
Loading…
Reference in New Issue
Block a user