[Fixed]-Django migrate and makemigrate automatic yes on prompt

22👍

found the answer on another question

You can use the ‘yes’ command which passes a ‘y’ to all questions

yes | python manage.py makemigrations myApp

if you want to edit the response (i.e send a ‘yes’ instead of ‘y’) you can add it as a parameter

yes yes | python manage.py migrate

21👍

Your migrations should run with the --noinput flag.

You may want to make sure you’re migrating the same app that you’ve created the migrations for.

Try running python manage.py showmigrations before and after running your migrations to see what’s going on.

👤jamjar

Leave a comment