How to insert ipython notebook into iframe (new)

I successfully achieved this using the method registered in Run IPython Notebook in an Iframe from another domain . However, this required editing the user configuration file. I really hoped that I could install this using the command line (for reasons).

http://ipython.org/ipython-doc/1/config/overview.html indicates that configuration via the command line is possible. However, all examples are designed to simply assign true / false values. To install a server to enable embedding, you must set the value inside the dictionary. I cannot figure out how to pass a dictionary through the command line.

Another acceptable option would be a configuration override file.

Some people wonder - why all this trouble!?!

First of all, it is not for production. I am trying to support non-developers by writing a web application that integrates Ipython laptops using iframes into it. Although it is on the same machine, it seems that the port number used is enough to mean that I cannot perform a simple iframe embed without setting the x-frame unreliable bit.

The ability to do this using the command line allows me to set the behavior in the script run, rather than linking a special configuration file inside my application, as well as writing the installer.

I really hope that I will formulate the question quite clearly! Thanks for any suggestions and help!

+5
source share
1 answer

Looking back at the IPython source for loaders, it looks like it will execute any python code that you put on the right side. I have not tested it, but based on the link you provided, you can probably pass something like

--NotebookApp.webapp_settings=dict('headers'=dict('X-Frame-Options'='ALLOW-FROM https://example.com/')) 
0
source

Source: https://habr.com/ru/post/1204961/


All Articles