jupyter_notebook_config.py 810 B

1234567891011121314151617181920212223242526272829303132
  1. lab_command = ' '.join([
  2. 'jupyter',
  3. 'lab',
  4. '--dev-mode',
  5. '--debug',
  6. '--extensions-in-dev-mode',
  7. '--no-browser',
  8. '--port={port}',
  9. '--ServerApp.ip=127.0.0.1',
  10. '--ServerApp.token=""',
  11. '--ServerApp.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. '--ServerApp.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': 60,
  24. 'absolute_url': True
  25. }
  26. }
  27. c.NotebookApp.default_url = '/lab-dev'
  28. import logging
  29. c.NotebookApp.log_level = logging.DEBUG