Refactor: split code into several django apps (we call them modules).
This commit is contained in:
18
dav_base/management/commands/disable_module.py
Normal file
18
dav_base/management/commands/disable_module.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)))
|
||||
Reference in New Issue
Block a user