Шаблон
<form action="/list" method="post">
{{ form.hidden_tag() }}
<input class="form-control form-control-lg" name="searching" type="search" placeholder="Поиск">
<input class="btn btn-fix btn-danger" id="submit" name="submit" type="submit" value="Искать">
</form>
форма:
class Search(FlaskForm):
searching = SearchField('Name', validators=[DataRequired()])
submit = SubmitField("Submit")
Поиск:
@app.route('/list')
def list():
product_list = db.session.query(Product).all()
form = Search()
if form.validate_on_submit():
q = form.searching.data
print(q)
return render_template('/products/products_list.html', title='Товары', product_list=product_list,
form=form)
Ошибка: Method Not Allowed
The method is not allowed for the requested URL.