访问bokeh服务器URL [英] Access bokeh server URL

查看:77
本文介绍了访问bokeh服务器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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆