I\'m working with a PyQt application which uses Django to deliver it\'s content to desktop users.
In the latest update we have stale content types stored in the data
On unix systems there is a command yes
, which will repeatedly output a string to stdout, separated by newlines. We can use this to auto-answer this prompt.
yes "yes" | python ./manage.py migrate
I use this command to automatically answer yes in my scripts when I'm doing Django migrations:
cat <(echo "yes") - | ./manage.py syncdb --migrate
Note that this only takes care of the first prompt. You can read more about the details of how this works and how to add an automatic answer to a second prompt here:
https://stackoverflow.com/a/16347534/1636882