Show More
@@ -1,9 +1,8 | |||
|
1 | """Base Tornado handlers for the notebook server.""" | |
|
1 | """Serve files directly from the ContentsManager.""" | |
|
2 | 2 | |
|
3 | 3 | # Copyright (c) IPython Development Team. |
|
4 | 4 | # Distributed under the terms of the Modified BSD License. |
|
5 | 5 | |
|
6 | import logging | |
|
7 | 6 | import os |
|
8 | 7 | import mimetypes |
|
9 | 8 | import json |
@@ -11,11 +10,6 import base64 | |||
|
11 | 10 | |
|
12 | 11 | from tornado import web |
|
13 | 12 | |
|
14 | try: | |
|
15 | from tornado.log import app_log | |
|
16 | except ImportError: | |
|
17 | app_log = logging.getLogger() | |
|
18 | ||
|
19 | 13 | from IPython.html.base.handlers import IPythonHandler |
|
20 | 14 | |
|
21 | 15 | class FilesHandler(IPythonHandler): |
@@ -49,3 +43,6 class FilesHandler(IPythonHandler): | |||
|
49 | 43 | self.write(model['content']) |
|
50 | 44 | self.flush() |
|
51 | 45 | |
|
46 | default_handlers = [ | |
|
47 | (r"/files/(.*)", FilesHandler), | |
|
48 | ] No newline at end of file |
@@ -34,8 +34,6 from jinja2 import Environment, FileSystemLoader | |||
|
34 | 34 | from zmq.eventloop import ioloop |
|
35 | 35 | ioloop.install() |
|
36 | 36 | |
|
37 | from IPython.html.files.handlers import FilesHandler | |
|
38 | ||
|
39 | 37 | # check for tornado 3.1.0 |
|
40 | 38 | msg = "The IPython Notebook requires tornado >= 3.1.0" |
|
41 | 39 | try: |
@@ -188,6 +186,7 class NotebookWebApplication(web.Application): | |||
|
188 | 186 | handlers.extend(load_handlers('tree.handlers')) |
|
189 | 187 | handlers.extend(load_handlers('auth.login')) |
|
190 | 188 | handlers.extend(load_handlers('auth.logout')) |
|
189 | handlers.extend(load_handlers('files.handlers')) | |
|
191 | 190 | handlers.extend(load_handlers('notebook.handlers')) |
|
192 | 191 | handlers.extend(load_handlers('nbconvert.handlers')) |
|
193 | 192 | handlers.extend(load_handlers('kernelspecs.handlers')) |
@@ -198,9 +197,6 class NotebookWebApplication(web.Application): | |||
|
198 | 197 | handlers.extend(load_handlers('services.nbconvert.handlers')) |
|
199 | 198 | handlers.extend(load_handlers('services.kernelspecs.handlers')) |
|
200 | 199 | handlers.append( |
|
201 | (r"/files/(.*)", FilesHandler), | |
|
202 | ) | |
|
203 | handlers.append( | |
|
204 | 200 | (r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}), |
|
205 | 201 | ) |
|
206 | 202 | # set the URL that will be redirected from `/` |
General Comments 0
You need to be logged in to leave comments.
Login now