Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from django.core.management.base import BaseCommand
# import ORM objects
class Command(BaseCommand):
help = 'help text'
def add_arguments(self, parser):
parser.add_argument(
'--test',
action='store_true',
dest='test',
help='this is a test switch'
)
def handle(self, *args, **options):
test = options['test']
print('my command')
# do stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.