Python Flask Basics Character Builder Flash a Message

Sam Donathan
Sam Donathan
12,669 Points

flash() a message in the fishy() view before the return. The message can have any content you want.

There is a bug and treehouse needs to fix it NOW!

flask_app.py
from flask import Flask, flash, redirect, render_template, \
     request, url_for

app = Flask(__name__)
app.secret_key = "jfie838jFJDFIJDL|{#"


@app.route('/')
def index():
    return render_template("index.html")

@app.route('/fishy')
def fishy():
    return redirect(url_for('index'))
Brandon Galde
Brandon Galde
9,477 Points

What error are you seeing? are you using flash() in your fishy() function? flash() takes 2 parameters: flash('<message>', '<category>').