Python full stack (ten) Django framework 6. ORM model basic use

One, ORM creates model and mapping database

1. Create a model

ORM models are generally placed in the models.py file in the app directory , and each app can have its own model.
If the model is to be mapped to the database, the app must be INSTALLED_APPSinstalled in settings.py .

The model established in models.py is as follows:

from datetime import datetime

from django.db import

Guess you like

Origin blog.csdn.net/CUFEECR/article/details/108573430