2018-11-11 12:41:48 +00:00
|
|
|
"""passbook core app config"""
|
2018-11-28 13:01:59 +00:00
|
|
|
from importlib import import_module
|
|
|
|
|
2018-11-11 12:41:48 +00:00
|
|
|
from django.apps import AppConfig
|
2019-10-07 14:33:48 +00:00
|
|
|
from django.conf import settings
|
2019-10-01 08:24:10 +00:00
|
|
|
from structlog import get_logger
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2019-10-04 08:08:53 +00:00
|
|
|
LOGGER = get_logger()
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2019-10-07 14:33:48 +00:00
|
|
|
|
2018-11-11 12:41:48 +00:00
|
|
|
class PassbookCoreConfig(AppConfig):
|
|
|
|
"""passbook core app config"""
|
|
|
|
|
|
|
|
name = 'passbook.core'
|
|
|
|
label = 'passbook_core'
|
2018-11-26 16:17:32 +00:00
|
|
|
verbose_name = 'passbook Core'
|
2019-06-25 16:00:54 +00:00
|
|
|
mountpoint = ''
|
2018-11-28 13:01:59 +00:00
|
|
|
|
|
|
|
def ready(self):
|
2019-10-07 14:33:48 +00:00
|
|
|
for factors_to_load in settings.PASSBOOK_CORE_FACTORS:
|
2019-02-16 08:52:37 +00:00
|
|
|
try:
|
|
|
|
import_module(factors_to_load)
|
2019-10-04 08:21:33 +00:00
|
|
|
LOGGER.info("Loaded factor", factor_class=factors_to_load)
|
2019-02-16 08:52:37 +00:00
|
|
|
except ImportError as exc:
|
|
|
|
LOGGER.debug(exc)
|