Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run IPython Notebook in Iframe from another Domain

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'

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

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

like image 803
robintibor Avatar asked Aug 15 '14 13:08

robintibor


1 Answers

Update

according to the comment by Harrison, it should be

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

now, see also http://jupyter-notebook.readthedocs.io/en/stable/config.html

Original Post

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 :)

like image 65
robintibor Avatar answered Nov 03 '22 15:11

robintibor