Access bokeh server URL

浪子不回头ぞ 提交于 2019-12-08 04:37:29

问题


I'd like to access my bokeh application's URL.

I tried:

curdoc().session_context.server_context.application_context.url

But it only gives me the last part of the URL.

Also, when acessing the HTTP request object from

curdoc().session_context.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).

How do I get the complete URL of the running bokeh application?

Thanks


回答1:


As suggested in the comments, this does not seem possible when using the bokeh server command.

I managed to use os.getenv('HOSTNAME') and session_context.server_context.application_context.url to rebuild the full url.

Thanks



来源:https://stackoverflow.com/questions/47348239/access-bokeh-server-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!