Show More
@@ -89,7 +89,7 b' ipython notebook --port=5555 --ip=* # Listen on port 5555, all interfaces' | |||
|
89 | 89 | |
|
90 | 90 | class NotebookWebApplication(web.Application): |
|
91 | 91 | |
|
92 | def __init__(self, ipython_app, kernel_manager, notebook_manager, log): | |
|
92 | def __init__(self, ipython_app, kernel_manager, notebook_manager, log, settings_overrides): | |
|
93 | 93 | handlers = [ |
|
94 | 94 | (r"/", ProjectDashboardHandler), |
|
95 | 95 | (r"/login", LoginHandler), |
@@ -111,7 +111,11 b' class NotebookWebApplication(web.Application):' | |||
|
111 | 111 | cookie_secret=os.urandom(1024), |
|
112 | 112 | login_url="/login", |
|
113 | 113 | ) |
|
114 | web.Application.__init__(self, handlers, **settings) | |
|
114 | ||
|
115 | # allow custom overrides for the tornado web app. | |
|
116 | settings.update(settings_overrides) | |
|
117 | ||
|
118 | super(NotebookWebApplication, self).__init__(handlers, **settings) | |
|
115 | 119 | |
|
116 | 120 | self.kernel_manager = kernel_manager |
|
117 | 121 | self.log = log |
@@ -243,6 +247,10 b' class NotebookApp(BaseIPythonApplication):' | |||
|
243 | 247 | help="Whether to prevent editing/execution of notebooks." |
|
244 | 248 | ) |
|
245 | 249 | |
|
250 | webapp_settings = Dict(config=True, | |
|
251 | help="Supply overrides for the tornado.web.Application that the " | |
|
252 | "IPython notebook uses.") | |
|
253 | ||
|
246 | 254 | enable_mathjax = Bool(True, config=True, |
|
247 | 255 | help="""Whether to enable MathJax for typesetting math/TeX |
|
248 | 256 | |
@@ -264,7 +272,7 b' class NotebookApp(BaseIPythonApplication):' | |||
|
264 | 272 | def _mathjax_url_default(self): |
|
265 | 273 | if not self.enable_mathjax: |
|
266 | 274 | return u'' |
|
267 | static_path = os.path.join(os.path.dirname(__file__), "static") | |
|
275 | static_path = self.webapp_settings.get("static_path", os.path.join(os.path.dirname(__file__), "static")) | |
|
268 | 276 | if os.path.exists(os.path.join(static_path, 'mathjax', "MathJax.js")): |
|
269 | 277 | self.log.info("Using local MathJax") |
|
270 | 278 | return u"static/mathjax/MathJax.js" |
@@ -315,7 +323,8 b' class NotebookApp(BaseIPythonApplication):' | |||
|
315 | 323 | super(NotebookApp, self).initialize(argv) |
|
316 | 324 | self.init_configurables() |
|
317 | 325 | self.web_app = NotebookWebApplication( |
|
318 | self, self.kernel_manager, self.notebook_manager, self.log | |
|
326 | self, self.kernel_manager, self.notebook_manager, self.log, | |
|
327 | self.webapp_settings | |
|
319 | 328 | ) |
|
320 | 329 | if self.certfile: |
|
321 | 330 | ssl_options = dict(certfile=self.certfile) |
General Comments 0
You need to be logged in to leave comments.
Login now