Most web applications are really about data, and in Django that data lives in models. A model is a Python class that describes a database table: each attribute is a field, and Django's ORM (object-relational mapper) translates your Python code into SQL so you can create, read, update, and delete records without writing queries by hand.
In this module you will learn how to define models and choose field types, how
makemigrations and migrate turn model changes into
database changes, and how to connect models with
ForeignKey, ManyToManyField, and
OneToOneField relationships. You will then query your data with
QuerySets, using filter(), exclude(),
field lookups, ordering, and slicing.
Watch the lessons in order, then continue on to The Django Admin. Some of these videos were recorded on older Django releases, so check the official documentation if a detail differs on your install.
Corey Schafer creates database tables from Django models, runs migrations, and uses the Django ORM to create and query records from the shell.
Shows how to use Django models to store data in a database with the ORM, and explains how migrations keep the database schema in sync with your models.
Covers models and migrations in more depth, including how to define relationships between models.
Covers filtering QuerySets with filter() and exclude(), field lookups, and how to order and slice results.