Skip to content

Commit 466b6bf

Browse files
authored
Configurable default_url for JupyterNotebookApp (#6899)
1 parent 16f5cb4 commit 466b6bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

notebook/app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from jupyterlab_server.handlers import _camelCase, is_url
2020
from notebook_shim.shim import NotebookConfigShimMixin # type:ignore
2121
from tornado import web
22-
from traitlets import Bool, default
22+
from traitlets import Bool, Unicode, default
2323

2424
from ._version import __version__
2525

@@ -120,7 +120,7 @@ class RedirectHandler(NotebookBaseHandler):
120120
@web.authenticated
121121
def get(self):
122122
"""Get the redirect url."""
123-
return self.redirect(self.base_url + "tree")
123+
return self.redirect(self.base_url.strip("/") + "/" + self.default_url.strip("/"))
124124

125125

126126
class TreeHandler(NotebookBaseHandler):
@@ -215,7 +215,7 @@ class JupyterNotebookApp(NotebookConfigShimMixin, LabServerApp):
215215
version = version
216216
app_version = version
217217
extension_url = "/"
218-
default_url = "/tree" # type:ignore
218+
default_url = Unicode("/tree", config=True, help="The default URL to redirect to from `/`")
219219
file_url_prefix = "/notebooks"
220220
load_other_extensions = True
221221
app_dir = app_dir

0 commit comments

Comments
 (0)