jupyter_notebook_config.py 786 B

12345678910111213141516171819202122232425262728293031
  1. lab_command = ' '.join([
  2. 'jupyter',
  3. 'lab',
  4. '--dev-mode',
  5. '--debug',
  6. '--no-browser',
  7. '--port={port}',
  8. '--NotebookApp.ip=127.0.0.1',
  9. '--NotebookApp.token=""',
  10. '--NotebookApp.base_url={base_url}lab-dev',
  11. # Disable dns rebinding protection here, since our 'Host' header
  12. # is not going to be localhost when coming from hub.mybinder.org
  13. '--NotebookApp.allow_remote_access=True'
  14. ])
  15. c.ServerProxy.servers = {
  16. 'lab-dev': {
  17. 'command': [
  18. '/bin/bash', '-c',
  19. # Redirect all logs to a log file
  20. f'{lab_command} >jupyterlab-dev.log 2>&1'
  21. ],
  22. 'timeout': 60,
  23. 'absolute_url': True
  24. }
  25. }
  26. c.NotebookApp.default_url = '/lab-dev'
  27. import logging
  28. c.NotebookApp.log_level = logging.DEBUG