Models in Code

Let's learn about the structure and syntax of writing models in Django.

Structure of model class

As we mentioned in the previous lesson, we have model classes that inherit from Django’s built-in models.Model class.

Let’s look at an example of a blog post to see the structure of a Model class:

Get hands-on with 1200+ tech skills courses.