
Hi, I am trying to embed a simple bokeh plot in a flask application for the first time. I have the below app.py in the root folder
from flask import Flask, render_template
from bokeh.plotting import figure, output_file, save
from bokeh.embed import components
from bokeh.io import show
app = Flask(__name__)
# Define our URLs and pages.
@app.route('/plot')
# def index():
# return 'Hello, World!'
def main():
plot = figure()
plot.circle([1,2],[3,4])
script, div = components(plot)
return render_template('plots.html', script=script, div=div)
if __name__=="__main__":
app.run(debug=True)
The plots.html code in the templates subfolder under the root folder.
<!DOCTYPE html>
<html>
<head>
<title>Plots</title>
<link href="http://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css" rel="stylesheet">
<link href="http://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.0.min.css" rel="stylesheet">
</head>
<body>
<h1>This is a heading</h1>
<div id="plot">
{{ script|safe }}
</div>
</body>
</html>
When I checked the browser console, I am getting the below error. Please help me fix this issue, thanks.



