执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument:
Posted pandaboy1123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 相关的知识,希望对你有一定的参考价值。
在执行python manage.py makemigrations时报错:
TypeError: __init__() missing 1 required positional argument: \'on_delete\'
解决方法:
在连接外键时加上:
on_delete=models.CASCADE
以上是关于执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 的主要内容,如果未能解决你的问题,请参考以下文章