Your models do not have primary keys. But they are being created automatically by django. You need to choose type of auto-created primary keys https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys (new in Django 3.2) Either add this into settings.py DEFAULT_AUTO_FIELD='django.db.models.AutoField' or add id in your models class Topic(models.Model): id = models.AutoField(primary_key=True) ...
Here is what the above code is Doing:
1. Importing the models module from the django.db package.
2. Defining a class named Topic that inherits from django.db.models.Model.
3. Defining a class variable named text, which is a CharField.
4. Defining a class variable named date_added, which is a DateTimeField.
5. Defining a class variable named owner, which is a ForeignKey.