Python Flask Basics Character Builder Flash a Message

Sam Donathan
Sam Donathan
12,968 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!
from flask import Flask, flash, redirect, render_template, \
     request, url_for

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

def index():
    return render_template("index.html")

def fishy():
    return redirect(url_for('index'))
Brandon Galde
Brandon Galde
12,573 Points

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