In particular I would like to know the base_url of the Notebook Server that the code is running in.
In IPython Notebooks version 2.x I used to do the following:
config = get_ipython().config
print config['NotebookApp']['base_url']
However this no longer works in IPython Notebook 3.x / Jupyter Notebooks.
EDIT: Some more detail on what I am trying to achieve.
I run various IPython Servers in separate Docker containers on the same host which are accessed through different base_urls. I would like to use the quantopian/qgrid package to display Pandas DataFrames inside the Notebook. Initially qgrid did not handle custom base_url prefixes for serving up a local copy of the Javascript dependencies but the code above allowed me to find the base_url in IPython 2 and to inject the relevant base_url into the Javascript template.
I would also like to use the mpld3 library in the Notebook and when browsing their documentation I found that they also mention that in "IPython 2.0+, local=True may fail if a url prefix is added (e.g. by setting NotebookApp.base_url)" so it seems that this is not an isolated problem and a good solution would be worthwhile.
Given @matt's comment below and thinking more about kernel vs frontend split, it makes sense that the NotebookApp config isn't accessible from the kernel. It's really the JS code that's generated that needs to know what the base_url is, so if someone can point me to where I can access this in the Notebook JS API, that should solve it.
base_url. What are you trying to achieve, then we can discuss where to get it. It depends on wether you do a JS extension, a server extension, or a kernel extension. - Matt