首页 > 其他分享> > DjangoModels修改后出现You are trying to add a non-nullable field 'download' to book without a d
DjangoModels修改后出现You are trying to add a non-nullable field 'download' to book without a d
作者:互联网
这个问题是在模型中新添加的,在原来已经有的表单中没有值。所以在新添加的值得括号中添加
如
1 download = models.ForeignKey(Download, on_delete=models.CASCADE, null=True)
然后
1 python manage.py makemigrations 2 3 python manage.py migrate
标签:py,models,manage,Please,existing,python,添加,something,download 来源: https://www.cnblogs.com/rstz/p/13271586.html