This commit is contained in:
@@ -3,7 +3,8 @@ from importlib.resources import files as resource_files
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from dav_base.config.modules import DJANGO_MAIN_MODULE, ModuleMeta
|
||||
from dav_base.constants import DJANGO_MAIN_MODULE, MODULE_APP_SETTINGS_PREFIX
|
||||
from dav_base.config.modules import ModuleMeta
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@@ -22,7 +23,9 @@ class Command(BaseCommand):
|
||||
if module_name in config.modules.keys():
|
||||
raise CommandError('Module \'{}\' is already enabled'.format(module_name))
|
||||
|
||||
settings_file_name = 'settings-{}.py'.format(module_name)
|
||||
settings_file_name = '{prefix}{module_name}.py'.format(prefix=MODULE_APP_SETTINGS_PREFIX,
|
||||
module_name=module_name)
|
||||
|
||||
input_file = resource_files(module_name).joinpath('django_project_config', settings_file_name)
|
||||
if input_file.is_file():
|
||||
output_file = os.path.join(django_base_dir, django_main_module, settings_file_name)
|
||||
|
||||
Reference in New Issue
Block a user