2009-09-24 23 views
1

我創建了一個json夾具,並將它放在myapp/fixtures /中。我已將myapp/fixtures添加到settings.FIXTURE_DIRS。 這是我嘗試裝入燈具的輸出:Django夾具沒有載入loaddata

[email protected]:~/myapp$ ./manage.py loaddata --verbosity=2 default.json 
Loading 'default' fixtures... 
[...truncated checking default paths and installed apps/fixtures...] 
Checking '/home/jeff/myapp/fixtures/' for fixtures... 
Trying '/home/jeff/myapp/fixtures/' for default.json fixture 'default'... 
No json fixture 'default' in '/home/jeff/myapp/fixtures/'. 
Trying '/home/jeff/myapp/fixtures/' for default.json.gz fixture 'default'... 
No json fixture 'default' in '/home/jeff/myapp/fixtures/'. 
Trying '/home/jeff/myapp/fixtures/' for default.json.zip fixture 'default'... 
No json fixture 'default' in '/home/jeff/myapp/fixtures/'. 
Trying '/home/jeff/myapp/fixtures/' for default.json.bz2 fixture 'default'... 
No json fixture 'default' in '/home/jeff/myapp/fixtures/'. 
Checking absolute path for fixtures... 
Trying absolute path for default.json fixture 'default'... 
No json fixture 'default' in absolute path. 
Trying absolute path for default.json.gz fixture 'default'... 
No json fixture 'default' in absolute path. 
Trying absolute path for default.json.zip fixture 'default'... 
No json fixture 'default' in absolute path. 
Trying absolute path for default.json.bz2 fixture 'default'... 
No json fixture 'default' in absolute path. 
No fixtures found. 
[email protected]:~/myapp$ ls fixtures/ 
defaults.json moneytrail.json 

這裏是什麼在default.json: [ { 「PK」:1, 「模式」: 「myapp.feature」, 「田「:{ 」default_feature「: 」0.25「 }} ]

我缺少明顯的東西嗎?我已經試過FIXTURE_DIRS作爲燈具和燈具/相同的結果。

謝謝。

回答

13

您的文件:defaults.json

你的命令行參數:default.json

仔細查看。

+7

該死的。時間放棄編程,並去建設。 – Jeff 2009-09-24 16:45:19

+9

堅持編程。像這樣的錯誤可能會導致房屋倒塌! – 2013-10-13 23:52:27

相關問題