AssertionError: A model can't have more than one AutoField.

问题:

Django在cmd运行时出现AssertionError: A model can't have more than one AutoField.这个错误

解决:

在models.py中添加这个primary_key=True,切记每一个自增得属性里面都要加呦!

猜你喜欢

转载自blog.csdn.net/m0_43432638/article/details/91399604