from django.core import managementmanagement.call_command('dumpdata', 'someapp', format='xml', indent=4)