From 91469d26721792235c9110524cb3b988ecc2708f Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 10 Oct 2017 18:04:45 +0200 Subject: [PATCH] allow setting token via JUPYTER_TOKEN env more convenient for certain deployments than CLI arguments --- notebook/notebookapp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index e355b23bd..51425b3e7 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -662,6 +662,9 @@ class NotebookApp(JupyterApp): @default('token') def _token_default(self): + if os.getenv('JUPYTER_TOKEN'): + self._token_generated = False + return os.getenv('JUPYTER_TOKEN') if self.password: # no token if password is enabled self._token_generated = False