Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable default_url in ExtensionApp #393

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jupyter_server/extension/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ def get_extension_point(cls):
# Extension URL sets the default landing page for this extension.
extension_url = "/"

default_url = Unicode().tag(config=True)

@default('default_url')
def _default_url(self):
return self.extension_url

# Extension can configure the ServerApp from the command-line
classes = [
ServerApp,
Expand Down Expand Up @@ -332,7 +338,6 @@ def _jupyter_server_config(cls):
base_config = {
"ServerApp": {
"jpserver_extensions": {cls.get_extension_package(): True},
"default_url": cls.extension_url
}
}
base_config["ServerApp"].update(cls.serverapp_config)
Expand Down Expand Up @@ -438,6 +443,9 @@ def _load_jupyter_server_extension(cls, serverapp):
if cls._is_starter_app:
serverapp._starter_app = extension
extension.initialize()
# Set the serverapp's default url to the extension's url.
if cls._is_starter_app:
serverapp.default_url = extension.default_url
return extension

@classmethod
Expand Down