Exemple #1
0
from polycommon.settings.celery import set_celery
from polycommon.settings.core import set_core
from polycommon.settings.logging import set_logging
from polycommon.settings.admin import set_admin
from polycommon.settings.secrets import set_secrets
from polyconf.config_manager import ROOT_DIR, config

context = locals()
set_logging(
    context=context,
    root_dir=ROOT_DIR,
    log_level=config.log_level,
    log_handlers=config.log_handlers,
    debug=config.is_debug_mode,
)
set_admin(context=context, config=config)
set_secrets(context=context, config=config)
set_apps(
    context=context,
    config=config,
    default_apps=("coredb.apps.CoreDBConfig",),
    third_party_apps=None,
    project_apps=("scheduler.apps.SchedulerConfig",)
)
set_core(context=context, config=config)
set_celery(context=context, config=config, routes=get_routes())

from polycommon.settings.defaults import *


Exemple #2
0
set_logging(
    context=context,
    root_dir=ROOT_DIR,
    log_level=config.log_level,
    log_handlers=config.log_handlers,
    debug=config.is_debug_mode,
)
set_admin(context=context, config=config)
set_secrets(context=context, config=config)
set_apps(
    context=context,
    config=config,
    default_apps=("coredb.apps.CoreDBConfig", ),
    third_party_apps=("rest_framework", "corsheaders"),
    project_apps=(
        "polycommon.apis.apps.CommonApisConfig",
        "django.contrib.admin",
        "django.contrib.admindocs",
        "apis.apps.APIsConfig",
        "polycommon.commands.apps.CommandsConfig",
    ),
)

set_core(context=context, config=config)
set_cors(context=context, config=config)
set_api(context=context, config=config)
set_middlewares(context=context, config=config)
set_assets(context=context, root_dir=ROOT_DIR, config=config)
if config.scheduler_enabled:
    set_celery(context=context, config=config, routes=get_routes())