Hi,

I'm trying to write a python script that would launch the Jupyter Notebook 
server with the additional arguments and had some issues passing the 
tornado_settings as an argument to launch_new_instance.

All the other settings are being passed and are set correctly, but when 
tornado_setting is passed as an argument, it works on some machines and 
doesn't on others.

Here's the code of what I am trying to do:

args += ['--NotebookApp.allow_origin="*"', 
              '--NotebookApp.disable_check_xsrf=True',
              '--NotebookApp.trust_xheaders=True',
              '--NotebookApp.open_browser=False',
              '--NotebookApp.token=""',
              '--NotebookApp.tornado_settings={ \'headers\': { 
\'Content-Security-Policy\': \'frame-ancestors \\"self\\" ' + path + '\' } 
}']

The error that I am seeing on some machines is the following:
 

[C 11:51:12.011 NotebookApp] The 'tornado_settings' trait of a NotebookApp 
instance must be a dict, but a value of class 'str' (i.e. '{ \'headers\': 
{\'Content-Security-Policy\': \'frame-ancestors *\\"self\\* 
<https://groups.google.com/>" Some\User\Path\' } }') was specified. 


I do understand that it doesn't like the fact that it received a string 
instead of a dict, but I don't understand why the same code works only on 
some machines and fails on others.

If there's a programmatic way of passing such configurations instead of 
modifying the jupyter_notebook_config.py file, it would be ideal as I don't 
want to overwrite the config file every time.

Thanks in advance for your help!
Young

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/70e16bd5-2152-493f-829e-749000507410%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to