django.db.utils.IntegrityError: (1048, "Column 'id' cannot be null") 明明添加了主键,指定了primary_key=True 仍然报上面的错 你需要auto_increment 把主键Field类型改成AutoField即可