Show More
@@ -136,10 +136,6 b' class IPythonHandler(AuthenticatedHandler):' | |||
|
136 | 136 | def base_url(self): |
|
137 | 137 | return self.settings.get('base_url', '/') |
|
138 | 138 | |
|
139 | @property | |
|
140 | def base_kernel_url(self): | |
|
141 | return self.settings.get('base_kernel_url', '/') | |
|
142 | ||
|
143 | 139 | #--------------------------------------------------------------- |
|
144 | 140 | # Manager objects |
|
145 | 141 | #--------------------------------------------------------------- |
@@ -181,7 +177,6 b' class IPythonHandler(AuthenticatedHandler):' | |||
|
181 | 177 | def template_namespace(self): |
|
182 | 178 | return dict( |
|
183 | 179 | base_url=self.base_url, |
|
184 | base_kernel_url=self.base_kernel_url, | |
|
185 | 180 | logged_in=self.logged_in, |
|
186 | 181 | login_available=self.login_available, |
|
187 | 182 | static_url=self.static_url, |
@@ -160,7 +160,6 b' class NotebookWebApplication(web.Application):' | |||
|
160 | 160 | # basics |
|
161 | 161 | log_function=log_request, |
|
162 | 162 | base_url=base_url, |
|
163 | base_kernel_url=ipython_app.base_kernel_url, | |
|
164 | 163 | template_path=template_path, |
|
165 | 164 | static_path=ipython_app.static_file_path, |
|
166 | 165 | static_handler_class = FileFindHandler, |
@@ -431,18 +430,6 b' class NotebookApp(BaseIPythonApplication):' | |||
|
431 | 430 | self.log.warn("base_project_url is deprecated, use base_url") |
|
432 | 431 | self.base_url = new |
|
433 | 432 | |
|
434 | base_kernel_url = Unicode('/', config=True, | |
|
435 | help='''The base URL for the kernel server | |
|
436 | ||
|
437 | Leading and trailing slashes can be omitted, | |
|
438 | and will automatically be added. | |
|
439 | ''') | |
|
440 | def _base_kernel_url_changed(self, name, old, new): | |
|
441 | if not new.startswith('/'): | |
|
442 | self.base_kernel_url = '/'+new | |
|
443 | elif not new.endswith('/'): | |
|
444 | self.base_kernel_url = new+'/' | |
|
445 | ||
|
446 | 433 | websocket_url = Unicode("", config=True, |
|
447 | 434 | help="""The base URL for the websocket server, |
|
448 | 435 | if it differs from the HTTP server (hint: it almost certainly doesn't). |
@@ -46,7 +46,7 b' class MainKernelHandler(IPythonHandler):' | |||
|
46 | 46 | km = self.kernel_manager |
|
47 | 47 | kernel_id = km.start_kernel() |
|
48 | 48 | model = km.kernel_model(kernel_id, self.ws_url) |
|
49 |
location = url_path_join(self.base_ |
|
|
49 | location = url_path_join(self.base_url, 'api', 'kernels', kernel_id) | |
|
50 | 50 | self.set_header('Location', url_escape(location)) |
|
51 | 51 | self.set_status(201) |
|
52 | 52 | self.finish(jsonapi.dumps(model)) |
@@ -85,7 +85,7 b' class KernelActionHandler(IPythonHandler):' | |||
|
85 | 85 | if action == 'restart': |
|
86 | 86 | km.restart_kernel(kernel_id) |
|
87 | 87 | model = km.kernel_model(kernel_id, self.ws_url) |
|
88 |
self.set_header('Location', '{0}api/kernels/{1}'.format(self.base_ |
|
|
88 | self.set_header('Location', '{0}api/kernels/{1}'.format(self.base_url, kernel_id)) | |
|
89 | 89 | self.write(jsonapi.dumps(model)) |
|
90 | 90 | self.finish() |
|
91 | 91 |
@@ -64,7 +64,7 b' class SessionRootHandler(IPythonHandler):' | |||
|
64 | 64 | else: |
|
65 | 65 | kernel_id = km.start_kernel(cwd=nbm.get_os_path(path)) |
|
66 | 66 | model = sm.create_session(name=name, path=path, kernel_id=kernel_id, ws_url=self.ws_url) |
|
67 |
location = url_path_join(self.base_ |
|
|
67 | location = url_path_join(self.base_url, 'api', 'sessions', model['id']) | |
|
68 | 68 | self.set_header('Location', url_escape(location)) |
|
69 | 69 | self.set_status(201) |
|
70 | 70 | self.finish(json.dumps(model, default=date_default)) |
@@ -48,7 +48,6 b' function (marked) {' | |||
|
48 | 48 | |
|
49 | 49 | var opts = { |
|
50 | 50 | base_url : IPython.utils.get_body_data("baseUrl"), |
|
51 | base_kernel_url : IPython.utils.get_body_data("baseKernelUrl"), | |
|
52 | 51 | notebook_path : IPython.utils.get_body_data("notebookPath"), |
|
53 | 52 | notebook_name : IPython.utils.get_body_data('notebookName') |
|
54 | 53 | }; |
@@ -21,7 +21,6 b' var IPython = (function (IPython) {' | |||
|
21 | 21 | this.name = notebook.notebook_name; |
|
22 | 22 | this.path = notebook.notebook_path; |
|
23 | 23 | this.base_url = notebook.base_url; |
|
24 | this.base_kernel_url = options.base_kernel_url || utils.get_body_data("baseKernelUrl"); | |
|
25 | 24 | }; |
|
26 | 25 | |
|
27 | 26 | Session.prototype.start = function(callback) { |
@@ -89,7 +88,7 b' var IPython = (function (IPython) {' | |||
|
89 | 88 | */ |
|
90 | 89 | Session.prototype._handle_start_success = function (data, status, xhr) { |
|
91 | 90 | this.id = data.id; |
|
92 |
var kernel_service_url = utils.url_path_join(this.base_ |
|
|
91 | var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels"); | |
|
93 | 92 | this.kernel = new IPython.Kernel(kernel_service_url); |
|
94 | 93 | this.kernel._kernel_started(data.kernel); |
|
95 | 94 | }; |
@@ -23,7 +23,6 b' window.mathjax_url = "{{mathjax_url}}";' | |||
|
23 | 23 | |
|
24 | 24 | data-project="{{project}}" |
|
25 | 25 | data-base-url="{{base_url}}" |
|
26 | data-base-kernel-url="{{base_kernel_url}}" | |
|
27 | 26 | data-notebook-name="{{notebook_name}}" |
|
28 | 27 | data-notebook-path="{{notebook_path}}" |
|
29 | 28 | class="notebook_app" |
@@ -13,7 +13,6 b'' | |||
|
13 | 13 | data-project="{{project}}" |
|
14 | 14 | data-base-url="{{base_url}}" |
|
15 | 15 | data-notebook-path="{{notebook_path}}" |
|
16 | data-base-kernel-url="{{base_kernel_url}}" | |
|
17 | 16 | |
|
18 | 17 | {% endblock %} |
|
19 | 18 |
@@ -121,8 +121,7 b' e.g. ``http://localhost:8888/ipython/``, you can do so with' | |||
|
121 | 121 | configuration options like the following (see above for instructions about |
|
122 | 122 | modifying ``ipython_notebook_config.py``):: |
|
123 | 123 | |
|
124 |
c.NotebookApp.base_ |
|
|
125 | c.NotebookApp.base_kernel_url = '/ipython/' | |
|
124 | c.NotebookApp.base_url = '/ipython/' | |
|
126 | 125 | c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipython/static/'} |
|
127 | 126 | |
|
128 | 127 | Using a different notebook store |
General Comments 0
You need to be logged in to leave comments.
Login now