Skip to content

Instantly share code, notes, and snippets.

@jgwerner
Created May 19, 2017 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgwerner/d0a6242f328d6f870dff5ada5ff91834 to your computer and use it in GitHub Desktop.
Save jgwerner/d0a6242f328d6f870dff5ada5ff91834 to your computer and use it in GitHub Desktop.
Jupyter Notebook config enabled for IFrames.
from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
import errno
import stat
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
c.NotebookApp.token = ''
c.NotebookApp.password = ''
c.NotebookApp.default_url = '/lab'
c.NotebookApp.tornado_settings = {
'headers': {
'Content-Security-Policy': "frame-ancestors 'https://mywebsite.example.com' 'self' "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment