Run custom admin command from view

You can use call_command:

from django.core.management import call_command
call_command('myadmincmd')

Leave a Comment