1
我想我自己的代码编辑器执行通过jupyter笔记本的代码和具有显示在我的web应用程序UI效果有没有办法整合Jupyter记事本到我的web应用程序
我想我自己的代码编辑器执行通过jupyter笔记本的代码和具有显示在我的web应用程序UI效果有没有办法整合Jupyter记事本到我的web应用程序
最简单的方法是嵌入整个在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 *"
}
}