-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEV: Added support for custom Notebook server base_url(s). Fixes #21. #22
base: master
Are you sure you want to change the base?
Conversation
@snth thanks!. LGTM, assigning to @TimShawver for testing/merge. |
@snth thanks for this PR. I tried this locally and it doesn't work on IPython 3, because the NotebookApp configuration is separate from the kernel's configuration (so We think the right way to fix this is to add an additional configuration option to the Since Let me know what you think. I know automatically detecting the base_url would be nicer, but I had trouble figuring out how to do that on IPython 3. That being said I think doing this via configuration will be more maintainable in that we won't have to have different code for every version of IPython. Thanks so much for your contributions. |
@TimShawver Thanks for testing this on IPython 3. I decided to try this out myself on a Windows machine and also had problems. I eventually got something to work which works across IPython 2.x and 3.x but I believe the original behaviour may be a bug in the 3.x series. I've posted it on StackOverflow here: http://stackoverflow.com/questions/31135008/how-does-one-access-the-configuration-from-inside-a-ipython-3-x-jupyter-notebo |
@snth the configuration of the notebook is intentionally not accessible from the IPython kernel (which is the process where the code in question is executing), because the kernels are meant to be compatible with multiple frontends, and the architecture of the kernel is such that it doesn't know whether it's connected to the notebook vs, e.g., the QTConsole or a terminal frontend. I'm pretty sure there's no supported way of reliably auto-detecting the base URL, so it think the right thing to do is make it explicitly configurable by the user. |
@ssanderson You're right, I hadn't thought about the kernel connecting to multiple frontends. The kernel is therefore not the right place to get this information. I think the Notebook JS API may know about this though and there might be a way to get it from there. I've updated my StackOverflow question to ask about this so let's see what comes back. |
I was just bitten by this. Have just hard-coded the |
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
…opian#36) Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
…n#37) Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
Without this change show_grid() will not work when you have a custom prefix such as '/MYAPP' as part of your URL.
This change allows it to work on my installation which has a custom prefix. I hope to have preserved the functionality on installations where a custom prefix isn't present but I don't have an instance like that to test it myself.
This fixes issue #21.