jupyter_notebook_config.py 869 B

123456789101112131415161718192021222324252627282930313233
  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.use_redirect_file=False',
  11. '--NotebookApp.base_url={base_url}lab-dev',
  12. # Disable dns rebinding protection here, since our 'Host' header
  13. # is not going to be localhost when coming from hub.mybinder.org
  14. '--NotebookApp.allow_remote_access=True'
  15. ])
  16. c.ServerProxy.servers = {
  17. 'lab-dev': {
  18. 'command': [
  19. '/bin/bash', '-c',
  20. # Redirect all logs to a log file
  21. f'{lab_command} >jupyterlab-dev.log 2>&1'
  22. ],
  23. 'timeout': 20,
  24. 'absolute_url': True
  25. }
  26. }
  27. c.NotebookApp.default_url = '/lab-dev'
  28. c.NotebookApp.use_redirect_file=False
  29. import logging
  30. c.NotebookApp.log_level = logging.DEBUG