Skip to content

Instantly share code, notes, and snippets.

@EtsuNDmA
Last active November 30, 2018 11:51
Show Gist options
  • Save EtsuNDmA/05250379edd36834aa7e703bd0bfa338 to your computer and use it in GitHub Desktop.
Save EtsuNDmA/05250379edd36834aa7e703bd0bfa338 to your computer and use it in GitHub Desktop.
Settings for Django kernel in Jupyter and JupyterLab
# Using Jupyter with Django
# Requires django_extensions
# For all settings see jupyter --help-all
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
import jupyterlab
notebook_default_url = '/lab' # Using JupyterLab
except ImportError:
notebook_default_url = '/tree' # Using Jupyter
os.environ.setdefault('BROWSER', 'google-chrome')
NOTEBOOK_ARGUMENTS = [
'--ip=0.0.0.0',
'--port=8888',
'--notebook-dir={}'.format(os.path.join(BASE_DIR, 'jupyter')),
# '--no-browser',
'--NotebookApp.token=<-verysecrettoken->',
'--NotebookApp.default_url={}'.format(notebook_default_url),
]
IPYTHON_KERNEL_DISPLAY_NAME = 'Django Kernel'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment