Refactor the initial setting bootstrap code

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-14 00:40:05 -04:00
parent 4a1607afad
commit c3793699c5
11 changed files with 420 additions and 225 deletions

View File

@@ -1,33 +1,28 @@
from __future__ import absolute_import, unicode_literals
from mayan.apps.smart_settings.utils import get_environment_setting
from . import * # NOQA
ALLOWED_HOSTS = ['*']
DEBUG = True
CELERY_TASK_ALWAYS_EAGER = get_environment_setting(
name='CELERY_TASK_ALWAYS_EAGER', fallback_default='true'
)
CELERY_TASK_EAGER_PROPAGATES = CELERY_TASK_ALWAYS_EAGER
CELERY_TASK_EAGER_PROPAGATES = CELERY_TASK_ALWAYS_EAGER # NOQA: F405
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
if 'rosetta' not in INSTALLED_APPS:
if 'rosetta' not in INSTALLED_APPS: # NOQA: F405
try:
import rosetta
import rosetta # NOQA: F401
except ImportError:
pass
else:
INSTALLED_APPS += (
INSTALLED_APPS += ( # NOQA: F405
'rosetta',
)
if 'django_extensions' not in INSTALLED_APPS:
try:
import django_extensions
import django_extensions # NOQA: F401
except ImportError:
pass
else:
@@ -37,7 +32,7 @@ if 'django_extensions' not in INSTALLED_APPS:
ROOT_URLCONF = 'mayan.urls.development'
TEMPLATES[0]['OPTIONS']['loaders'] = (
TEMPLATES[0]['OPTIONS']['loaders'] = ( # NOQA: F405
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)