code: def extract_conf_from(mod, conf=ModuleConfig(CONF_SPEC), depth=0, max_depth=2):
      for key, default_value in six.iteritems(conf):
          conf[key] = _get_key_from_module(mod, key, default_value)
      try:
          filtered_apps = [app for app in conf['apps'] if app not in BLACKLIST]
      except TypeError:
          pass
      except Exception as e:
          warnings.warn('Error %s during loading %s' % (e, conf['apps']))
      for app in filtered_apps:
          try:
              app_module = import_module(app)
              if app_module != mod:
                  app_module = _get_correct_module(app_module)
                  if depth < max_depth:
                      mod_conf = extract_conf_from(app_module, depth=depth+1)
                      for k, v in six.iteritems(mod_conf):
                          if k == 'config':
                              continue
                          if isinstance(v, dict):
                              conf[k].update(v)
                          elif isinstance(v, (list, tuple)):
                              conf[k] = merge(conf[k], v)
          except Exception as e:
              pass
      return conf