Can stale content types be automatically deleted in Django?

前端 未结 2 1894
抹茶落季
抹茶落季 2020-12-19 06:08

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

相关标签:
2条回答
  • 2020-12-19 06:31

    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

    0 讨论(0)
  • 2020-12-19 06:39

    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

    0 讨论(0)
提交回复
热议问题