Django Fixtures反序列化错误:无法解码JSON对象

时间:2017-07-18 06:16:28

标签: python json django django-fixtures

我正在尝试拨打python manage.py loaddata fixture_20170717.json但我收到以下错误:

  

文件" C:\ Users \ Anon \ Anaconda2 \ lib \ json \ decoder.py",第382行,   raw_decode引发ValueError("没有JSON对象可以被解码")   django.core.serializers.base.DeserializationError:安装问题   夹具   ' d:\ resi_django \ viewer_django \ topology_viewer \观察者\夹具\ fixture_20170717.json&#39 ;:   没有JSON对象可以被解码

" fixture_20170717.json"文件看起来像这样:

  

[{" model":" viewer.net"," pk":1," fields":{" net_name&#34 ;:   " Aarnet-tz","数据":{" graph_data":{"节点":[" Perth1", " Sydney2&#34 ;,   " Sydney1"," Armidale"," Brisbane1"," Brisbane2"," Darwin",   " Adelaide1"," Adelaide2"," Rockhampton"," Alice,Springs"," Cairns",   " Melbourne1"," Canberra2"," Canberra1"," Melbourne2"," Hobart",   " Perth2"," Townsville"],"链接":[[" Perth1"," Adelaide1"],[ " Perth1&#34 ;,   " Perth2"],[" Sydney2"," Brisbane2"],[" Sydney2"," Armidale"],   [" Sydney2"," Sydney1"],[" Sydney2"," Melbourne2"],[" Sydney1",   " Brisbane1"],[" Sydney1"," Canberra2"],[" Brisbane1"," Brisbane2"],   ["布里斯班1","罗克汉普顿"],["达尔文","阿德莱德1"],["达尔文",   " Alice,Springs"],[" Adelaide1"," Melbourne1"],[" Adelaide1",   " Adelaide2"],[" Adelaide2"," Melbourne2"],[" Adelaide2",   " Alice,Springs"],[" Adelaide2"," Perth2"],[" Rockhampton",   "汤斯维尔"],["凯恩斯","汤斯维尔"],["墨尔本1","霍巴特"],   [" Melbourne1"," Canberra1"],[" Melbourne1"," Melbourne2"],   [" Canberra2"," Canberra1"],[" Melbourne2"," Hobart"]]}," city_data" :   {" Perth1":{" lat":-31.93333," long":115.83333}," Sydney2":{   " lat":-33.86785," long":151.20732}," Sydney1":{" lat":-33.86785,   " long":151.20732}," Armidale":{" lat":-30.51667," long":151.65},   " Brisbane1":{" lat":-27.46794," long":153.02809}," Brisbane2":{   " lat":-27.46794," long":153.02809}," Darwin":{" lat":-12.46113,   " long":130.84185}," Adelaide1":{" lat":-34.93333," long":138.6},   " Adelaide2":{" lat":-34.93333," long":138.6}," Rockhampton":{   " lat":-23.38333," long":150.5}," Alice,Springs":{" lat":-23.7,   " long":133.88333}," Cairns":{" lat":-16.91667," long":145.76667   }," Melbourne1":{" lat":-37.814," long":144.96332}," Canberra2":{   " lat":-35.28346," long":149.12807}," Canberra1":{" lat":   -35.28346," long":149.12807}," Melbourne2":{" lat":-37.814," long":144.96332},& #34;霍巴特":{" lat":-42.87936," long":147.32941   }," Perth2":{" lat":-31.93333," long":115.83333}," Townsville":{   " lat":-19.25," long":146.8}}}}},{" model":" viewer.net",& #34; PK&#34 ;:   2,"字段":{" net_name":" Abilene-tz","数据":{" graph_data" :{   "节点":["休斯顿","印第安纳波利斯","芝加哥","洛杉矶,洛杉矶",   " Denver"," New,York"," Washington,DC"," Sunnyvale"," Kansas,City" ,   "亚特兰大","西雅图"],"链接":[["休斯顿","堪萨斯州,城市"] ,   [" Houston"," Atlanta"],[" Houston"," Los,Angeles"],[" Indianapolis" ;,   " Kansas,City"],[" Indianapolis"," Atlanta"],[" Indianapolis",   " Chicago"],[" Chicago"," New,York"],[" Los,Angeles"," Sunnyvale&# 34],   [" Denver"," Kansas,City"],[" Denver"," Seattle"],[" Denver&#34 ;,   " Sunnyvale"],[" New,York"," Washington,DC"],[" Washington,DC",   "亚特兰大"],[" Sunnyvale","西雅图"]]}," city_data":{"休斯顿" :{   " lat":29.76328," long":-95.36327}," Indianapolis":{" lat":   39.76838,

...

  

" Eastern,Province":{" lat":-13.0," long":32.25},   " Northern,Province":{" lat":-11.0," long":31.0}," Livingstone":{   " lat":-17.84194," long":25.85425},"大学,赞比亚":{" lat":   -15.40809," long":28.28636}}}}}]

长54169行,UTF-8编码。我正在尝试将此fixture加载到postgresql数据库中。有没有办法得到更有用的错误信息?

0 个答案:

没有答案