Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在django中加载夹具失败。自动字段的值为0_Mysql_Django_Json_Fixtures - Fatal编程技术网

Mysql 在django中加载夹具失败。自动字段的值为0

Mysql 在django中加载夹具失败。自动字段的值为0,mysql,django,json,fixtures,Mysql,Django,Json,Fixtures,我试图从我用dumpdata命令创建的django装置加载数据 manage.py dumpdata --format=json MyApp > MyApp/fixtures/test_data.json 我想用它作为我的单元测试的初始数据 class SomeTest(TestCase): fixtures = ['test_data.json'] 但我在运行测试时出错 ValueError:安装夹具时出现问题 数据库后端不接受0作为AutoField的值 我正在运行djan

我试图从我用dumpdata命令创建的django装置加载数据

manage.py dumpdata --format=json MyApp > MyApp/fixtures/test_data.json
我想用它作为我的单元测试的初始数据

class SomeTest(TestCase):
    fixtures = ['test_data.json']
但我在运行测试时出错

ValueError:安装夹具时出现问题 数据库后端不接受0作为AutoField的值


我正在运行django版本1.5和mysql版本5.2.40。谷歌搜索到目前为止并没有真正起到帮助作用。有什么想法吗?谢谢你的帮助D

看一看这里,这可能取决于它