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

Allow for additional tornado handlers in the notebook server #2694

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 7 additions & 0 deletions IPython/frontend/html/notebook/notebookapp.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def __init__(self, ipython_app, kernel_manager, notebook_manager,
cookie_name='username-%s' % uuid.uuid4(), cookie_name='username-%s' % uuid.uuid4(),
) )


additional_handlers = settings_overrides.pop("handlers", [])

# allow custom overrides for the tornado web app. # allow custom overrides for the tornado web app.
settings.update(settings_overrides) settings.update(settings_overrides)


Expand All @@ -179,6 +181,11 @@ def __init__(self, ipython_app, kernel_manager, notebook_manager,
new_handler = tuple([pattern]+list(handler[1:])) new_handler = tuple([pattern]+list(handler[1:]))
new_handlers.append( new_handler ) new_handlers.append( new_handler )


new_handlers += [
(a[0], import_item(a[1])) + tuple(a[2:])
for a in additional_handlers
]

super(NotebookWebApplication, self).__init__(new_handlers, **settings) super(NotebookWebApplication, self).__init__(new_handlers, **settings)


self.kernel_manager = kernel_manager self.kernel_manager = kernel_manager
Expand Down