O'Reilly logo

Mastering Flask by Jack Stouffer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Securing Your App

We have a mostly functioning blog app, but it is missing some crucial features, such as user login, registration, and adding and editing posts from the browser. The user login functionality can be created in many different ways, so each of the sections demonstrates mutually exclusive methods to create logins. The first way is directly using the browser's cookies, and the second way is using a Flask extension named Flask Login.

Setting up

Before we jump right into making a user authentication system, there is a lot of setup code. To run any type of authentication, our app will need the following elements common to all:

  • First, the user models will need proper password hashing
  • Second, a login form and a registration form ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required