Hi, I have a bokeh app which i am trying to render thru Flask. Bokeh and Flask are installed on Ubuntu VM (on AWS, just in case that matters). The below code works only if i replace localhost:5006/env
with the public.ip:5006/env
. If i change the url in the below code to locahost:5006/env
i get a blank page (at my.public.ip:5000).
from bokeh.resources import CDN
from flask import Flask, render_template
from bokeh.embed import server_document,server_session
from bokeh.client import pull_sessionapp = Flask(name)
@app.route(β/β)
def index():
myurl = βhttp://localhost:5006/envβ
bokeh_script = server_document(myurl)
return render_template(βindex.htmlβ,bokeh_script=bokeh_script)#run the app
if name == βmainβ:
app.run(host=β0.0.0.0β) #app.run(debug=True)
Any idea why this is happening? What could be the fix for it? I am trying not to hardcode the public IP in my code.