class Command(BaseCommand):
args = 'Arguments is not needed'
help = 'Django admin custom command poc.'
def handle(self, *args, **options):
db_alias = options.get('olddb')
db_entry = settings.DATABASES.get(db_alias)
output = open(output_filename,'w')
cmd = ["mysqldump",
"-u", db_entry.get('USER'),
"-p%s" % db_entry.get('PASSWORD'),
"-h", db_entry.get('HOST'),
db_entry.get('NAME')]
subprocess.call(cmd, stdout=output)
class Command(BaseCommand):
args = 'Arguments