5、TypeError: Order() got an unexpected keyword argument ‘xxx‘

problem:
Insert picture description here

Solution:

Check the model field in your own model class

Insert picture description here

My mistake is that the model field has an extra id, so be careful :

Before the error: address_id = models.ForeignKey(Address, models.CASCADE)

After modification: address = models.ForeignKey(Address, models.CASCADE)

Guess you like

Origin blog.csdn.net/Erudite_x/article/details/112988830