执行python manage.py makemigrations时报错(装载)

原文:https://blog.csdn.net/hello__jerry/article/details/79531532

在执行python manage.py makemigrations时报错:
TypeError: init() missing 1 required positional argument: ‘on_delete’
解决方法:
在连接外键时加上:

on_delete=models.CASCADE