Skip to main content

Django subcommands

Project description

Installation

$ [sudo] pip install django-subcommands

Classes

class __doc__
django_subcommands.SubCommands SubCommands class. attrs: subcommands (dict)

Examples

management/commands/command.py

from django.core.management.base import BaseCommand
import django_subcommands

class SubCommand1(BaseCommand):
    def handle(self, *args, **options):
        ...

class SubCommand2(BaseCommand):
    def handle(self, *args, **options):
        ...

class Command(django_subcommands.SubCommands):
    subcommands = {"subcommand1": SubCommand1,"subcommand2":SubCommand2}
$ python manage.py command subcommand1

readme-generator

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page