found an answer to another question
You can use the yes command, which passes "y" to all questions
yes | python manage.py makemigrations myApp
if you want to edit the answer (for example, send "yes" instead of "y"), you can add it as a parameter
yes yes | python manage.py migrate
source share