Creating our first model
A Django model is a Python class that represents a database table. Models are used to define the structure and behavior of the data that will be stored in the database. Each model class typically corresponds to a single database table, and each instance of the class represents a specific row in that table. More information about Django models can be found here: https://docs.djangoproject.com/en/5.0/topics/db/models/.
We can create models such as Movie, Review, and Order, and Django turns these models into a database table for us.
Here are the Django model basics:
- Each model is a class that extends
django.db.models.Model
- Each model attribute represents a database column
- With all of this, Django provides us with a set of useful methods to create, update, read, and delete (CRUD) model information from a database
Creating a Movie model
Our first model will be a Movie. We can create models in each of the project apps. Movie seems...