Django command

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


log = logging.getLogger(f"cmd:{__name__.split('.')[-1]}")


class Command(BaseCommand):
    def add_arguments(self, parser):
        parser.add_argument(
            "--verbose",
            action="store_true",
            default=False,
            help="Show verbose output"
        )

    def handle(self, *args, **options):
        if options["verbose"]:
            log.setLevel(logging.DEBUG)