allow setting token via JUPYTER_TOKEN env

more convenient for certain deployments than CLI arguments
This commit is contained in:
Min RK 2017-10-10 18:04:45 +02:00
parent 2ee51ab09f
commit 91469d2672

View File

@ -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