
When I run my bokeh app locally, following the flask_embed.py example on the Bokeh Git, it works fine. But running it on Heroku, it shows the html template page but not the Bokeh app.
I can attach the heroku error logs if need be. Thanks.
def bkapp(doc):
textin = TextInput(title = "Submit Blog Post:")
button = Button(label="Submit", button_type="success")
p = Paragraph(text="Blog entry here")
def update_data(event):
data = str(textin.value)
vector = transformer.transform([' '.join(clean(data))])
result = model.predict(vector)
if int(result) == 1:
pred_text = 'Male'
else:
pred_text = 'Female'
output = {'prediction': pred_text}
p.text = "{}".format(output)
button.on_click(update_data)
box = WidgetBox(children = [textin, button, p])
doc.add_root(box)
@app.route('/', methods=['GET'])
def bkapp_page():
script = server_document('https://blog-nlp.herokuapp.com/bkapp')
return render_template("embed.html", script=script, template="Flask")
def bk_worker():
server = Server({'/bkapp': bkapp}, io_loop=IOLoop())
server.start()
server.io_loop.start()
Thread(target=bk_worker).start()
if __name__ == '__main__':
app.run()

