Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aamishbaloch/50dccff72a6d5c19bc0528ddd67fa3f0 to your computer and use it in GitHub Desktop.
Save aamishbaloch/50dccff72a6d5c19bc0528ddd67fa3f0 to your computer and use it in GitHub Desktop.
Execute Management Command Programmatically

Execute Management Command Programmatically

Sometimes you have to run the management commands in some tasks or other sort of programmatical features. So you can do this very easily.

How to run?

You can run this programmatically as follows:

from django.core.management import call_command
call_command('{command name}', interactive=True/False)

Don't forget to give star to the gist. Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment