从另一个域运行iframe中的IPython Notebook [英] Run IPython Notebook in Iframe from another Domain

查看:373
本文介绍了从另一个域运行iframe中的IPython Notebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在另一台服务器上的iframe内运行我服务器上的IPython笔记本。
我收到此错误:

I want to run an IPython notebook that is on my server inside an iframe on another server. I get this error:

Refused to display 'my_url/Test.ipynb' in a frame because 
it set 'X-Frame-Options' to 'SAMEORIGIN'

这里它说我应该设置一些x-frame-header选项:
http: //ipython.org/ipython-doc/dev/whatsnew/development.html#iframe-embedding

Here it says I should set some x-frame-header option for this: http://ipython.org/ipython-doc/dev/whatsnew/development.html#iframe-embedding

我在哪里可以设置它?如何更改此X-Frame-Option以便可以从其他站点嵌入? :)

Where can I set this? How to change this X-Frame-Option so that it can be embedded from another site? :)

推荐答案

更新

根据哈里森的评论,它应该是

according to the comment by Harrison, it should be

c.NotebookApp.tornado_settings = {'headers': {'X-Frame-Options': 'ALLOW-FROM https://example.com/'}}

现在,另见 http://jupyter-notebook.readthedocs.io/en/stable/ config.html

原始帖子

好的我找到了解决方案正在运行,但我不能100%确定它是否是正确的方法:
.ipython / your_profile / ipython_notebook_config.py 添加

Ok I found a solution that is working but I am not 100% sure if it is the right way to do it: In .ipython/your_profile/ipython_notebook_config.py add

c.NotebookApp.webapp_settings = {'headers': {'X-Frame-Options': 'ALLOW-FROM https://example.com/'}}

适用于我,但不确定这是否会覆盖龙卷风或其他任何设置:)

Works for me, but not sure if this overrides more settings from tornado or anything :)

这篇关于从另一个域运行iframe中的IPython Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆