📅  最后修改于: 2022-03-11 14:46:39.781000             🧑  作者: Mango
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)
...