...

/

Getting Started with Models

Getting Started with Models

In this lesson, we will find out how to create models in our Flask application.

Introduction

You might recall that at the beginning of this course, we learned about three components of a web application:

  1. Views
  2. Templates
  3. Models

In previous lessons, we have covered two of these components (views and templates). In this lesson, we will figure out how to create models. Later in the course, we will also get to know how to manipulate these models.

Steps to create a User model in a database

Again, let’s get help from the example we have been using. We used a dictionary to store the user’s data.

users = {
    "archie.andrews@email.com": "football4life",
   
...