回答

0

最简单的方法是嵌入整个在iframe页:

<iframe src="http://localhost:8888" /> 

一件事,应该指出的是,Jupyter笔记本默认情况下只允许从页面同一产地通过在头设置frame-ancestors将它嵌入:

'headers': { 
    'Content-Security-Policy': "frame-ancestors 'self'" 
} 

为了将它嵌入到自己的应用程序,你需要在jupyter_notebook_config.py覆盖设置允许任何网页中嵌入它:

c.NotebookApp.tornado_settings = { 
    'headers': { 
     'Content-Security-Policy': "frame-ancestors *" 
    } 
} 
相关问题