0

I am trying to backup a django app via the built in "dumpdata" command:

python manage.py dumpdata --exclude=contenttypes --indent=4 > path_to_dumped_data.json

But the json data is being printed to the screen and the file remains empty

Any ideas

(python2.6, django 1.2.3, Ubuntu 10.04 LTS)

1
  • dumpdata definitely prints to stdout by default. What happens when you run $ python manage.py dumpdata --exclude=contenttypes --indent=4 > /dev/null ? Commented Dec 6, 2010 at 16:18

1 Answer 1

2

Try using &> or 2>. Although weird, the output might be printed to standard error output.

Sign up to request clarification or add additional context in comments.

2 Comments

Just to check I ran this via the subprocess module - nothing went to stdout, everything to stderr with an error code of 0!
That seems like bad behavior to me. According to docs.djangoproject.com/en/dev/ref/django-admin/… dumpdata "Outputs to standard output" so that's clearly a bug. I've submitted a bug here: code.djangoproject.com/ticket/14847

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.