The free flash

Report a typo

Make a program that shows only error flash messages.

Pay attention to the by_category argument in the get_flashed_messages() function.
Write a program in Python 3
from flask import Flask, flash, get_flashed_messages

app = Flask('main')

@app.route('/')
def main_view():
flash("It's cold in the graveyard", 'info')
flash("You don't know whos is behind you.", 'ahtung')
flash('There is no pain', 'error')
flash('What are you receiving', 'interest')

return get_flashed_messages()
___

Create a free account to access the full topic