- Based on gist: https://gist.github.com/Wildcarde/6841f00f0a0cd52ade09964a0fdb5684 to embed interactive Bokeh chart into Flask
- Updated code based on Bokeh==0.12.14 (autoload_server is deprecated since 0.12.7 Aug 2017)
- For other code, refer to link above.
Last active
March 28, 2018 02:31
-
-
Save coderfever/a634226809a227850966d57712a0ad2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, flash, redirect, render_template, request, session, abort | |
from bokeh.embed import server_document | |
# import bokeh | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
# script=server_document(model=None,app_path="/bokeh-sliders",url="http://localhost:5006") | |
script=server_document("http://localhost:5006/bokeh-sliders") | |
print(script) | |
return render_template('hello.html',bokS=script) | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment