错误:
TypeError: __init__() missing 1 required positional argument: 'on_delete'
解决办法:即在外键值的后面加上 on_delete=models.CASCADE
question = models.ForeignKey(Question,on_delete=models.CASCADE)
Django在根据models生成数据库表时报 __init__() missing 1 required positional argument: 'on_delete'
最新推荐文章于 2021-05-22 09:43:33 发布