Python Forum

Full Version: [Flask] html error 405
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't figure out why I am getting the html error 405. Thanks in advance
def search():
    form = SearchForm()
    if form.validate_on_submit():
        user = User.query.filter_by(
        if user:
            return redirect(url_for('user_posts', username=user.username))
            flash(f'The user {} does not exist', 'warning')
            return redirect(url_for('search'))
    return render_template('search.html', title='Searching User', form=form)

Forgot to add methods to the @app.route