执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

在执行python manage.py makemigrations时报错:

TypeError: __init__() missing 1 required positional argument: 'on_delete'

解决方法:

在连接外键时加上:

on_delete=models.CASCADE
Win a contest, win a challenge
原文地址:https://www.cnblogs.com/pandaboy1123/p/8830910.html