gpt4 book ai didi

jupyter-notebook - 将 Jupyterlab 嵌入网站

转载 作者:行者123 更新时间:2023-12-01 06:04:05 42 4
gpt4 key购买 nike

我可以将 JupyterLab 嵌入网站吗?目前它会引发帧祖先自身错误。是否可以更改一些配置以允许将其嵌入 iframe 中?

最佳答案

是的。 JupyterHub 和单用户 Jupyter Notebook/Lab 服务器的默认设置都配置为禁止外部域嵌入页面。作为一种解决方法,您可以在 frame-ancestors 指令中包含您的域:

  • jupyterhub_config.py:
    c.JupyterHub.tornado_settings = {
    'headers': {
    'Content-Security-Policy':
    "frame-ancestors 'self' http://yourdomain.com"
    }
    }
  • jupyter_notebook_config.py:
    c.NotebookApp.tornado_settings = {
    'headers': {
    'Content-Security-Policy':
    "frame-ancestors 'self' http://yourdomain.com"
    }
    }

  • 如果您使用基于 Kubernetes 的设置进行部署,则配置略有不同,涉及使用这些配置编写/构建单用户服务器的 Dockerfile。您可以查看 my GitHub repo我不久前创建的,将引导您完成这些步骤。

    关于jupyter-notebook - 将 Jupyterlab 嵌入网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42021672/

    42 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com