Hi Everyone,
I have been updating my application to work with bokeh 0.11, although I am still not able to get anything to run on an actual web-facing application. I have a very simple plot coming from a Flask view.
@main.route(’/_get_chart’, methods=[‘POST’])
def get_chart():
…
plot = Line(data=df)
session = push_session(curdoc())
script = autoload_server(plot, session_id=session.id)
return jsonify({‘plot_tag’: script })
This works on my development server (local machine), although once I try to put it on an actual web-facing server, the autoload.js is refused.
On the development machine, I start the server with (env)$ bokeh serve --allow-websocket-origin=127.0.0.1:5000
On the server, I start it with (env)$ bokeh serve --allow-websocket-origin=45...**:8098
The error I am getting from the web-facing server in the javascript console is:
GET http://localhost:5006/autoload.js?bokeh-autoload-element=09ab05db-8a33-4295…eh-session-id=i0ZMNFuvUMmhYpaIVaeG2po4PWWU9KuyX1TQ8sswuA6m&_=1458238746733 net::ERR_CONNECTION_REFUSED
When the chart is requested, The web-facing bokeh server debug log is showing the following:
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.tornado:[pid 25191] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 25191] / has 1 sessions with 0 unused
DEBUG:bokeh.server.session:pushing doc to session u’4g6Yj2kQ2CwULKDBqJo39s1XT2g9YusTDeNnKACvKVo6’
DEBUG:bokeh.server.tornado:[pid 25191] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 25191] / has 1 sessions with 0 unused
And this is from the bokeh server output on the local development server:
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.tornado:[pid 21464] 1 clients connected
DEBUG:bokeh.server.session:pushing doc to session u’Laj6FCXEhKYYtBjf4k9Pmi1LiLbsrES4YDX3hVAgB1Eh’
INFO:tornado.access:200 GET /autoload.js?bokeh-autoload-element=6f65f30d-f9a9-4512-8d1c-bbb292ad8337&bokeh-session-id=Laj6FCXEhKYYtBjf4k9Pmi1LiLbsrES4YDX3hVAgB1Eh&_=1458240123400 (127.0.0.1) 5.94ms
INFO:tornado.access:200 GET /static/js/bokeh.min.js?v=b0e2720e424bae5562ceecc6d83c2044 (127.0.0.1) 4.01ms
INFO:tornado.access:200 GET /static/js/bokeh-compiler.min.js?v=34cb81b761c2c28f1955c7bb98dab3a9 (127.0.0.1) 1.21ms
INFO:tornado.access:200 GET /static/js/bokeh-widgets.min.js?v=8e88133dddc48883a815d4278dd80f9a (127.0.0.1) 1.27ms
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)
INFO:bokeh.server.views.ws:ServerConnection created
INFO:tornado.access:200 GET /static/css/bokeh.min.css?v=486d3195473d3e39ad36f2888fefe389 (127.0.0.1) 0.78ms
DEBUG:bokeh.server.session:Sending pull-doc-reply from session u’Laj6FCXEhKYYtBjf4k9Pmi1LiLbsrES4YDX3hVAgB1Eh’
INFO:tornado.access:200 GET /static/css/bokeh-widgets.min.css?v=0bbd11cf0fab2f648f3918c073bc9c3d (127.0.0.1) 1.55ms
On the development server, if I enter $ curl http://localhost:5006/autoload.js?bokeh-autoload-element=78f39b60-5d55-4248…eh-session-id=JwjPY7koQTzKx2yXGOC1ZY2qlodDbdZgPcMMDnrxFSLg, I will get the javascript file returned just fine.
From what I understood, changing to the Tornado server in V 0.11 was going to address these CORS issues. Is anyone aware of a bokeh application that is running on an actual web-facing server? All I have seen to this point are demos running on local machines or in iPython notebooks.