raise an CommandError exception, with an arguent: string "App '%s' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations.", where '%s' is replaced for app_config.label.
raise CommandError ( "App '%s' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations." % app_config . label )