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
Use redirect for new notebooks #2218
Conversation
Seems reasonable, and the redirect works. I haven't examined how this interacts with #2206. Shall we merge? |
I just want @ellisonbg to say what he think of it, |
using redirect for notebook copy also. |
Ok, it should work with prefixes also now. |
login_available=self.login_available, | ||
mathjax_url=self.application.ipython_app.mathjax_url, | ||
) | ||
self.redirect((('/',self.application.ipython_app.base_project_url, notebook_id))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to have a urljoin
here?
stupid me. Should be better now. also applied your suggestion about |
login_available=self.login_available, | ||
mathjax_url=self.application.ipython_app.mathjax_url, | ||
) | ||
self.redirect('/'+urljoin(self.application.ipython_app.base_project_url, notebook_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance that base_project_url
is a full URL (i.e., http://.../
) instead of just a relative URL? It seems that it might be easier to just do something like:
self.redirect(self.application.ipython_app/base_project_url.rstrip('/') + '/' + notebook_id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not according to the doc,
And for example, I access the same server, sometime throught 127.0.0.1 and sometime through 192.x.x.x ... it will be annoying to have an hardcoded ip or hostname...
I think that |
Done. |
OK this looks great and I confirm that it works fine without the update_url calls. I am going to test one more thing and then merge. |
Use redirect for new notebooks
Use redirect for new notebooks
As of ipython/ipython#2218, IPython server redirects when creating a new notebook. However, redirection on local server does not work in url-retrieve. See: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12374 This bug in url-retrieve is handled in the newly introduced error callback.
* Workaround the bug in url-retrieve to make notebook creation work for the recent developmental version of IPython. See: ipython/ipython#2218 * Some refactoring around messaging: ein-notebooklist.el uses `ein:log' instead of `message' now.
fixes #2217
Pinging @dlsun,
This should fix the issue you have for new tabs for new notebooks.