jupyter_notebook_config.py 752 B

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