Tljh+jupyter-proxy-server for flask

I’m using the littlest jupyterhub to teach all the things Python because the lab I was assigned doesn’t have Python installed locally. Asked on twitter ( and was recommended Jupyter-proxy server, so installed it and enabled the lab extension and I have no idea how to configure this for flask or if it’s even installed properly (is there a test?)
Thanks, Hannah

ETA: I’ve since broken this so badly that notebook will load but lab won’t and I don’t know how to figure out the issue (tired jupyter --debug & jupyter --troubleshoot)

When I used jupyter-server-proxy to make the VS Code binder I had to run these three lines:

in addition to installing the jupyter-server-proxy package via a requirements.txt. After that it worked for proxying arbitrary ports. I’m not sure if you need the lab extension to make the proxying work or if that is just needed if you want the clever “launcher icon” thing.

One additional thing to note: if you are using TLJH all your users have to share the available ports, so they can’t all use port 5000 and they can look at each other’s work if they know the port someone else is using. To get that kind of separation you need to use containers or some other advanced magic (maybe someone knows if you can use systemd units and isolate network interfaces?).

1 Like

The port thing isn’t a problem 'cause flask takes a port arg. Will try your fix soon ish. Also do you have any tips for unbreaking /lab being a blank page? I think I installed stuff to user and system when trying to install the extensions

1 Like

No idea. I have to (shamefully) admit that I hardly ever use the lab interface :-/ Classic notebook for life :fist:

1 Like