mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Expand user home path in template search path.
cause that pretty much always what you want to do if you have a `~` ina path.
This commit is contained in:
parent
a712e079b4
commit
9d58482944
@ -146,9 +146,13 @@ 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_url = py3compat.unicode_to_str(base_url, 'ascii')
|
||||
template_path = settings_overrides.get("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"))
|
||||
if isinstance(_template_path, str):
|
||||
_template_path = (_template_path,)
|
||||
template_path = [os.path.expanduser(path) for path in _template_path]
|
||||
|
||||
jenv_opt = jinja_env_options if jinja_env_options else {}
|
||||
env = Environment(loader=FileSystemLoader(template_path),**jenv_opt )
|
||||
env = Environment(loader=FileSystemLoader(template_path), **jenv_opt)
|
||||
settings = dict(
|
||||
# basics
|
||||
log_function=log_request,
|
||||
|
Loading…
Reference in New Issue
Block a user