Access bokeh server URL

2019-06-10 20:00发布

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://bokeh.pydata.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条回答
三岁会撩人
2楼-- · 2019-06-10 20:17

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

查看更多
登录 后发表回答