Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Now that we can save posts in the database, let's create a form and view for capturing them from the user.
We assigned the database and the current user, from Flask Login, to the g
object, Flask's global attribute that gets passed around to all of our views automatically, so now we can use it to get the current user.
Alert!
In this video and the others in this course, you'll see me using {{ current_user.is_authenticated() }}
. At the time of filming, this was the correct way to use the is_authenticated()
method on the UserMixin
from flask-login
. BUT, as is often the case in open source, things have changed. You'll now want to always use it as a property instead. So, use {{ current_user.is_authenticated }}
instead. No parentheses!
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Dan Roney
Python Development Techdegree Student 11,129 Points1 Answer
View all discussions for this video
Related 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