September 2019
Beginner to intermediate
494 pages
13h
English
We have discussed in the previous section that Django's logic is implemented in a model-oriented way, which means that each entity in our web application should be designed as a Django model. In this section, we will examine the specific process of writing a model in Django.
Navigate to the library folder within our project, and open up its models.py file, which was generated automatically when the library application was created. As the name suggests, we will keep all the models that pertain to the library application and their respective logic in this file. The file should already contain the following code:
from django.db import models# Create your models here.
Now, we will implement two separate models—Author and ...
Read now
Unlock full access