Django:The database backend does not accept 0 as a value for AutoField

最近要用到Django,换成mysql出现了以下问题:

The database backend does not accept 0 as a value for AutoField

 

解决方法:

cd 到对应的目录

sed -i.old s|\(ForeignKey.*\)default=0|\1default=None|g 0005_*.py

即可解决

 

感谢:http://askbot.org/en/question/11851/valueerror-the-database-backend-does-not-accept-0-as-a-value-for-autofield/

 

Django:The database backend does not accept 0 as a value for AutoField,布布扣,bubuko.com

文章来自:http://www.cnblogs.com/brucezhu/p/3898706.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3