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(username=form.username.data).first()
        if user:
            return redirect(url_for('user_posts', username=user.username))
        else:
            flash(f'The user {form.username.data} 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