Can stale content types be automatically deleted in Django?

帅比萌擦擦* 提交于 2019-11-29 10:20:32

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!