开发者

Django Fixtures Error: Unknown application

I have a project w/ multiple apps. I am attempting to use the dumpdata command to 开发者_如何学Ccreate a fixture for each app. Calling dumpdata on a given app seems to work well.

This prints the data to the console:

python manage.py dumpdata myapp

However, when I attempt to create a json file containing the dumped data:

python manage.py dumpdata apps/myapp/fixtures/initial_data.json

This error is thrown:

Error: Unknown application: apps/myapp/fixtures/initial_data

The fixtures dir already exists and I've tried multiple variations of the path to the json file. There is another coder on the project and we are working with the same source code. He does not appear to be running into the same issue though.

We are using Django 1.2.


You give the correct syntax in your first snippet. The argument after dumpdata is an application, not a file.

If you want to save that output to a file, you use standard redirection:

python manage.py dumpdata myapp > apps/myapp/fixtures/initial_data.json
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜