from django import db


class Command(BaseCommand):
    help = 'Output SQL for migration'

def handle(self, *app_labels, **options):
    db.reset_queries()
from django.core.management import call_command
kw = {'db-dry-run': 1, 'verbosity': 0}
call_command('migrate', **kw)
for query in db.connection.queries:
    pass
Django - South - Есть ли способ просмотреть SQL, который он запускает?