
Hi All,
I just started with Bokeh but have been doing Python for about two years (super new to this). I currently have an app made in Flask and wanted the Bokeh server to appear on one of the sections.
The development flask server is hosted locally from my Mac using the computer’s name as the URL in the following format .local:8080/
The development Bokeh server is also launched from the same Mac using the URL http://127.0.0.1:5006/bkapp (I’m using the flask embedded method)
I launch the Flask app using the following code: flask run --host=0.0.0.0 --port 8080 --cert=adhoc
if I remove --cert=adhoc and launch the web server and go to the URL .local:8080/ it shows but if I launch the web server with --cer=adhoc the app loads but the bokeh content is missing.
If I hit F12 and look at the network section I get some errors:
Websocket connection ‘wss://127.0.0.1:5006/bkapp/ws’ failed:
[bokeh] failed to connect to bokeh server: could not open websocket
[bokeh] failed to load bokeh session : Error: could not open websocket
Error rendering Bokeh items: error: could not open websocket
at d._on_error ()
at socket.onerror ()
Below is the code I’m using for the server document and io_loop:
‘’’
def bkapp_page():
script = server_document(‘http://127.0.0.1:5006/bkapp’)
return render_template(“embed.html”, script=script, template=“Flask”)
def bk_worker():
# Can’t pass num_procs > 1 in this configuration. If you need to run multiple
# processes, see e.g. flask_gunicorn_embed.py
server = Server({‘/bkapp’: bkapp}, io_loop=IOLoop(), allow_websocket_origin=[“*”])
server.start()
server.io_loop.start()
‘’’
I am grateful for any help that can be provided.
-Cass

