码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-08-08 11:51:35      阅读:1491      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   for   问题   div   

最近要用到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

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

标签:style   blog   http   color   io   for   问题   div   

原文地址:http://www.cnblogs.com/brucezhu/p/3898706.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!