forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jupyter_notebook_config.py
58 lines (51 loc) · 1.26 KB
/
jupyter_notebook_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
common = [
'--no-browser',
'--debug',
'--port={port}',
'--ServerApp.ip=127.0.0.1',
'--ServerApp.token=""',
# Disable dns rebinding protection here, since our 'Host' header
# is not going to be localhost when coming from hub.mybinder.org
'--ServerApp.allow_remote_access=True'
]
lab_command = ' '.join([
'jupyter',
'lab',
'--dev-mode',
'--extensions-in-dev-mode',
'--collaborative',
'--ServerApp.base_url={base_url}lab-dev',
] + common + ['>jupyterlab-dev.log 2>&1'])
lab_splice_command = ' '.join([
'jupyter',
'lab',
'build',
'--splice-source',
'--minimize=False',
'--dev-build=True',
'--debug',
'>jupyterlab-spliced.log 2>&1',
'&&',
'jupyter',
'lab',
'--ServerApp.base_url={base_url}lab-spliced',
] + common + ['>jupyterlab-spliced.log 2>&1'])
c.ServerProxy.servers = {
'lab-dev': {
'command': [
'/bin/bash', '-c', lab_command
],
'timeout': 60,
'absolute_url': True
},
'lab-spliced': {
'command': [
'/bin/bash', '-c', lab_splice_command
],
'timeout': 300,
'absolute_url': True
}
}
c.NotebookApp.default_url = '/lab-dev'
import logging
c.NotebookApp.log_level = logging.DEBUG