Book Image

Learning Flask Framework

Book Image

Learning Flask Framework

Overview of this book

Table of Contents (17 chapters)
Learning Flask Framework
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we added user authentication to the blogging app. We created a User model, which securely stores a user's login credentials in the database, then built views for logging users in and out of the site. We added a signal handler that runs before every request and retrieves the current user, then learned how to use this information in the views and templates. In the second half of the chapter, we integrated the User model with the Entry model, making our blog more secure in the process. The chapter wrapped up with a brief discussion of Flask sessions.

In the next chapter, we will build an administrative dashboard that will allow super-users to perform actions such as creating new users and modifying site content. We will also collect and display various site metrics, such as page-views, to help visualize what content is driving the most traffic.