makemigrations' input prompt from the user

I have a CI/CD pipeline for a Django project.
It includes makemigrations and migrate.
Issue is, sometimes makemigrations requires input from the user like ‘did you rename a field’ or default values for existing records.
How are such situations handled ?

Personally, I would never try to include a makemigrations in a CI/CD pipeline. From our perspective, that’s something that a developer needs to run and verify before checking the code into git, especially if you have multiple people working on code concurrently.

The migrate command can be run with the --no-input parameter.

So what’s an ideal CI/CD pipeline for Django based projects ?
Do I push the migrations folders also to the repository ?
Right now I have in my .gitignore :
migrations/

Absolutely - it’s code in your project. It’s as much a part of the code for your project as your models and views. It’s essentially the same reason why you don’t want to arbitrarily delete migration files without fully understanding the implications of doing it.

Also, see the docs at Workflow and Version control.

Don’t forget, developers can also manually create migrations to do things that makemigrations can’t - such as data migrations.

I don’t know what would be considered “ideal”, but I know we pull code, test it, then build the docker containers in ours. We certainly don’t generate or create code in that process.