【发布时间】:2018-06-14 23:30:58
【问题描述】:
如何使用 iframe 在网页上实时嵌入 Jupyter(未转换为 HTML)?我们正在尝试将来自 JupyterHub 的实时 Jupyter 笔记本嵌入到编程教程中。我相信我必须启用与 CORS 相关的功能?谢谢大家的时间。
【问题讨论】:
标签: python jupyter-notebook jupyter jupyterhub
如何使用 iframe 在网页上实时嵌入 Jupyter(未转换为 HTML)?我们正在尝试将来自 JupyterHub 的实时 Jupyter 笔记本嵌入到编程教程中。我相信我必须启用与 CORS 相关的功能?谢谢大家的时间。
【问题讨论】:
标签: python jupyter-notebook jupyter jupyterhub
您已将网页的 url 放在 jupyterhub_config.py(jupyterhub 的配置文件)和 jupyter_notebook_config.py(笔记本的配置文件)中的 Content-Security-Policy 中。
在 jupyterhub_config.py 中
c.JupyterHub.tornado_settings = {
'headers': {
'Content-Security-Policy': "frame-ancestors 'self' http://<your-webpage-url>"
}
}
在 jupyter_notebook_config.py 中
c.NotebookApp.tornado_settings = {
'headers': {
'Content-Security-Policy': "frame-ancestors 'self' http://<your-webpage-url>:4200"
}
}
【讨论】: