Set SECKET_KEY, then flashing message in view function:
from flask import Flask, flash, render_template
app = Flask(__name__)
app.secret_key = 'some_secret'
@app.route('/')
def index():
flash('Hello, I'm a message.')
return render_template('index.html')
Then render the messages...