【问题标题】:How to embed Jupyter live on a webpage?如何在网页上实时嵌入 Jupyter?
【发布时间】:2018-06-14 23:30:58
【问题描述】:

如何使用 iframe 在网页上实时嵌入 Jupyter(未转换为 HTML)?我们正在尝试将来自 JupyterHub 的实时 Jupyter 笔记本嵌入到编程教程中。我相信我必须启用与 CORS 相关的功能?谢谢大家的时间。

【问题讨论】:

    标签: python jupyter-notebook jupyter jupyterhub


    【解决方案1】:

    您已将网页的 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"
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-19
      • 1970-01-01
      • 2012-08-14
      • 2012-02-27
      • 2017-05-05
      • 2013-08-05
      • 2011-11-17
      相关资源
      最近更新 更多