2015-01-12 45 views
0

全部。 我想將IpythonNotebook嵌入到我的頁面中。我想通過iFrame來做像wakari的人(https://wakari.io/)。 但默認情況下禁止Ipython NB。 當將IPythonNotebook嵌入iframe

<iframe id="NBframe" src="http://localhost:8888/notebooks/Untitled0.ipynb"></iframe> 

我收到

Refused to display 'http://localhost:8888/notebooks/Untitled0.ipynb' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 

我如何幀這個網頁?可能是Ipython中的某個配置? 謝謝!

編輯

需要添加這ipython_notebook_config

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

回答

0

在您需要設置的X架選件,就目前掌握的和即將推出的3.0使用CSP 2.X。

在這兩種情況下,請看這裏:https://github.com/ipython/ipython/pull/7016

+0

感謝馬特的指導方針。最後我發現了一個我必須添加到我的配置文件中的配置。 –