19 lines
534 B
Python
19 lines
534 B
Python
from django.conf import settings
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Disable a modular app from django-dav installation.'
|
|
|
|
def add_arguments(self, parser):
|
|
parser.add_argument('module')
|
|
|
|
def handle(self, *args, **options):
|
|
module_name = options['module']
|
|
|
|
config = settings.MODULE_CONFIG
|
|
del config.modules[module_name]
|
|
config.save()
|
|
|
|
self.stdout.write(self.style.SUCCESS('Module \'{}\' disabled.'.format(module_name)))
|