Вот вьюшка, показывает запись(стих) и содержит форму отправки комментария:
@app.route('/comment_entry/<int:id>', methods=['GET', 'POST'])
@login_required
def comment_entry(id):
title = 'Показать стих'
comment_entry = Entry.query.get_or_404(id)
form = CommentForm()
if current_user and form.validate_on_submit():
comment_add = Comment(body=form.body.data,
pub_date=datetime.now(),
author_comment=current_user,
entry_comment=comment_entry)
db.session.add(comment_add)
db.session.commit()
flash('Вы добавили свой комментарий')
return redirect(url_for('comment_entry', id=comment_entry.id))
return render_template('entry/comment_entry.html',
title=title, entry=comment_entry, form=form)
При отправке комментария получаю ошибку 404.
Вот часть шаблона этой вьюшки:
{{ form.hidden_tag() }}
{{ form.body.label }}:
{{ form.body(cols=52, rows=4) }}
{% for error in form.errors.body %}
{{ error }}
{% endfor %}
Почему я получаю такую ошибку?