Python 本地Web应用程序未加载,Bokeh Plot内联嵌入失败

Python 本地Web应用程序未加载,Bokeh Plot内联嵌入失败,python,html,python-2.7,bokeh,Python,Html,Python 2.7,Bokeh,我正在构建一个利用Bokeh库的Python web应用程序。我想使用Bokeh的内联嵌入过程在html页面中显示绘图,但是出现了一些问题,我很难找到我所犯的错误 当我在本地运行应用程序并尝试生成Bokeh绘图时,出现以下错误:“浏览器(或代理)发送了此服务器无法理解的请求” 一般来说,我对Python和编程几乎没有什么经验,所以如果我的代码有时很笨拙,我深表歉意 我没有运行Bokeh服务器,从我在文档中了解的情况来看,这种形式的嵌入(?)是不必要的。如果有其他方法可以使用Bokeh服务器在ht

我正在构建一个利用Bokeh库的Python web应用程序。我想使用Bokeh的内联嵌入过程在html页面中显示绘图,但是出现了一些问题,我很难找到我所犯的错误

当我在本地运行应用程序并尝试生成Bokeh绘图时,出现以下错误:“浏览器(或代理)发送了此服务器无法理解的请求”

一般来说,我对Python和编程几乎没有什么经验,所以如果我的代码有时很笨拙,我深表歉意

我没有运行Bokeh服务器,从我在文档中了解的情况来看,这种形式的嵌入(?)是不必要的。如果有其他方法可以使用Bokeh服务器在html w/o中嵌入绘图,请共享

在html中,我添加了Bokeh脚本和链接标记:

<head>   
    <meta charset="utf-8">
    <link href=
"http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"
rel="stylesheet">
<link
    href="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.css"
    rel="stylesheet" type="text/css">
<script src="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.js"></script>
{{ script }}
</head>
如果我的代码中有错误,它应该在这里的某个地方。。。否则我可能会错过什么?任何帮助都将不胜感激

@app.route('/', methods=['GET', 'POST'])
def index():
    form = Regression(request.form)
    if request.method == 'POST' and form.validate():
        if request.form['btn'] == 'Plot Regression':
            regr = reg(form.ticker.data, form.months.data)
            b1, b2, b3, r, a = regr.b1, regr.b2, regr.b3, regr.r2, regr.a
            script, div = plotreg(b3, a, regr.xreturn, regr.yreturn)
        else:
            script, div = plotprice(form.ticker.data, form.months.data)
            b1, b2, b3, r, a = None, None, None, None, None
    else:
        b1, b2, b3, r, a, script, div = None, None, None, None, None, None, None
    return render_template('index.html',form=form, b1=b1, b2=b2, b3=b3, r=r, a=a, script=script, div=div)