访问bokeh服务器URL [英] Access bokeh server URL
问题描述
我想访问我的 bokeh 应用程序的URL.
I'd like to access my bokeh application's URL.
我尝试过:
curdoc().session_context.server_context.application_context.url
但是它只给我URL的最后一部分.
But it only gives me the last part of the URL.
此外,当从
curdoc().session_context.request
只能查询arguments
成员(如 https://docs.bokeh.org/en/latest/docs/user_guide/server.html#accessing-the-http-request ).
Only the arguments
member can be queried (as defined in https://docs.bokeh.org/en/latest/docs/user_guide/server.html#accessing-the-http-request).
如何获取正在运行的bokeh应用程序的完整URL?
How do I get the complete URL of the running bokeh application?
谢谢
推荐答案
如注释中所建议,在使用bokeh server
命令时,这似乎是不可能的.
As suggested in the comments, this does not seem possible when using the bokeh server
command.
我设法使用os.getenv('HOSTNAME')
和session_context.server_context.application_context.url
重建了完整的URL.
I managed to use os.getenv('HOSTNAME')
and session_context.server_context.application_context.url
to rebuild the full url.
谢谢
这篇关于访问bokeh服务器URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!