django run management command from code code example
Example: django run management command from code
from django.core.management import call_command
call_command('my_command', 'foo', bar='baz')
from django.core.management import call_command
call_command('my_command', 'foo', bar='baz')