我注意到一个错误:
werkzeug.routing.buildError:无法为终结点“foo.bar,id=1”生成URL。你是说“foo.bar”吗?
foobp= Blueprint('foo', __name__)
@foobp.route('/bar/<id>', , methods=['get', 'post'])
def bar(id):
id_var = id
form = SomeForm()
if form.validate_on_submit():
return redirect(url_for('foo.bar, id={}'.format(id_var)))
return render_template('bar'html, form=form, ...)
我试过把
'foo.bar'
做的只是
'bar'
但这似乎也行不通。
我做错什么了?