@@ -7,8 +7,8 @@ This folder contains an example of 2 simple extensions on top of Jupyter Server.
7
7
You need ` python3 ` to build and run the server extensions.
8
8
9
9
``` bash
10
- conda create -y -n jext python=3.7 && \
11
- conda activate jext && \
10
+ conda create -y -n jupyter_server_example python=3.7 && \
11
+ conda activate jupyter_server_example && \
12
12
pip install -e .
13
13
```
14
14
@@ -33,10 +33,11 @@ pip uninstall -y simple_ext
33
33
python setup.py install
34
34
cp -r ./etc $( dirname $( which jupyter) ) /..
35
35
# Start the jupyter server extension simple_ext1, it will also load simple_ext2 because of load_other_extensions = True..
36
+ # When you invoke with the entrypoint, the default url will be opened in your browser.
36
37
jupyter simple-ext1
37
38
```
38
39
39
- Now you can render Extension 1 Server content in your browser.
40
+ Now you can render ` Extension 1 ` Server content in your browser.
40
41
41
42
``` bash
42
43
# Jupyter Server Home Page.
@@ -60,7 +61,7 @@ open http://localhost:8888/simple_ext1/redirect
60
61
open http://localhost:8888/static/simple_ext1/favicon.ico
61
62
```
62
63
63
- You can also render Extension 2 Server content in your browser.
64
+ You can also render ` Extension 2 ` Server content in your browser.
64
65
65
66
``` bash
66
67
# HTML static page.
@@ -71,7 +72,7 @@ open http://localhost:8888/simple_ext2/params/test?var1=foo
71
72
72
73
## Settings
73
74
74
- Start with additional settings.
75
+ Stop any running server ( with CTRL+C) and start with additional settings on the command line .
75
76
76
77
``` bash
77
78
jupyter server --ServerApp.jpserver_extensions=" {'simple_ext1': True, 'simple_ext2': True}" --SimpleApp1.cli=OK
@@ -83,12 +84,12 @@ Check the log, it should return on startup something like the following base on
83
84
[SimpleApp1] SimpleApp1.app OK
84
85
[SimpleApp1] SimpleApp1.file OK
85
86
[SimpleApp1] SimpleApp1.cli OK
86
- [SimpleApp1] Complete Settings {'simple_ext1_config': {}, 'simple_ext1_template_paths': ['/home/datalayer/repos/jupyter-server/examples/simple/simple_ext1/templates'], 'simple_ext1_jinja2_env': <jinja2.environment.Environment object at 0x105ed7438>, 'log_function': <function log_request at 0x105e2d950>, 'base_url': '/', 'default_url': '/', 'template_path': ['/opt/datalayer/opt/miniconda3/envs/datalayer/lib/python3.7/site-packages/jupyter_server', '/opt/datalayer/opt/miniconda3/envs/datalayer/lib/python3.7/site-packages/jupyter_server/templates'], 'static_path': ['/opt/datalayer/opt/miniconda3/envs/datalayer/lib/python3.7/site-packages/jupyter_server/static'], 'static_custom_path': ['/home/datalayer/.jupyter/custom', '/opt/datalayer/opt/miniconda3/envs/datalayer/lib/python3.7/site-packages/jupyter_server/static/custom'], 'static_handler_class': <class 'jupyter_server.base.handlers.FileFindHandler'>, 'static_url_prefix': ...
87
+ [SimpleApp1] Complete Settings {'simple_ext1_config': {}, 'simple_ext1_template_paths': ['/home/datalayer/repos/jupyter-server/examples/simple/simple_ext1/templates'], 'simple_ext1_jinja2_env': <jinja2.environment.Environment object at 0x105ed7438>, 'log_function': <function log_request at 0x105e2d950>, 'base_url': '/', 'default_url': '/', 'template_path': ...
87
88
```
88
89
89
90
## Start only Extension 2
90
- `
91
- Now stop the server and start again with only Extension 2.
91
+
92
+ Now stop agin the server and start with only ` Extension 2 ` .
92
93
93
94
``` bash
94
95
# Start the jupyter server extension simple_ext2, it will NOT load simple_ext1 because of load_other_extensions = False.
@@ -103,10 +104,14 @@ Try with the above links to check that only Extension 2 is responding (Extension
103
104
104
105
The ` --hello ` flag will log on startup ` Hello Simple11 - You have provided the --hello flag or defined a c.SimpleApp1.hello == True ` .
105
106
107
+ The ` --simple11-dir ` alias will set ` SimpleExt11.simple11_dir ` settings.
108
+
109
+ Stop any running server and then start the simple-ext11.
110
+
106
111
``` bash
107
- jupyter simple-ext11 --hello
112
+ jupyter simple-ext11 --hello --simple11-dir any_folder
108
113
# or...
109
- jupyter server --ServerApp.jpserver_extensions=" {'simple_ext11': True}" --hello
114
+ jupyter server --ServerApp.jpserver_extensions=" {'simple_ext11': True}" --hello --simple11-dir any_folder
110
115
```
111
116
112
117
Ensure the following URLs give respond correctly.
0 commit comments