django 2.X 关联 外键时会报错:TypeError: __init__() missing 1 required positional argument: ‘on_delete’ 10条回复 django 2.X 关联 外键时会报错:TypeError: __init__() missing 1 required positional argument: ‘on_delete’ #python3 manage.py makemigrations 报错: 解决办法: contact = models.ForeignKey(Contact, on_delete=models.CASCADE) 加参数: on_delete=models.CASCADE 赞分享