【发布时间】:2010-11-30 23:14:03
【问题描述】:
我创建了一个 json 夹具,并将它放在我的 myapp/fixtures/ 中。我已将 myapp/fixtures 添加到 settings.FIXTURE_DIRS。 这是我尝试加载夹具的输出:
jeff@jeff-linux:~/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.
jeff@jeff-linux:~/myapp$ ls fixtures/
defaults.json moneytrail.json
这是 default.json 中的内容: [ { “PK”:1, “模型”:“myapp.feature”, “字段”:{ “default_feature”:“0.25” } } ]
我在这里遗漏了一些明显的东西吗?我已经尝试将 FIXTURE_DIRS 作为固定装置和固定装置/相同的结果。
谢谢。
【问题讨论】: