Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
If we want to give the user a message that's only visible for the current load of the page, we use the `flash()` function. Just another handy tidbit from the Flask.
New Terms
flash()
: This function stores a message in the session that will self-destruct after the response is returned.
get_flashed_messages()
: This function gets all of the flash messages stored in the session.
app.secret_key
: This configuration attribute stores the secret key that all messages are cryptographically signed with.
{% with %}
: The Flask template version of Python's with
block. Let's you temporarily define a variable. Must be closed with {% endwith %}
.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up