join it with app into a string, separated with string '; ', substitute it for name_str. substitute '%s\ in string "Conflicting migrations detected (%s).\nTo fix them run 'python manage.py makemigrations --merge'",
raise CommandError ( "Conflicting migrations detected (%s).\nTo fix them run 'python manage.py makemigrations --merge'" % name_str )