繁体   English   中英

有没有办法将Jupyter笔记本集成到我的Web应用程序

[英]Is there way to Integrate Jupyter note book to my web application

我希望自己的代码编辑器通过jupyter笔记本执行代码,并且必须在Web应用程序UI中显示结果

最简单的方法是将整个页面嵌入iframe

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

需要注意的一件事是,默认情况下,Jupyter笔记本仅允许通过在标头中设置帧祖先来将同一原始页面嵌入到页面中:

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

为了将其嵌入您自己的应用中,您需要覆盖jupyter_notebook_config.py的设置以允许任何页面嵌入它:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM