code: def cfg(self):
          
          config = LStruct(self.defaults)
          module = config['CONFIG'] = os.environ.get(
              CONFIGURATION_ENVIRON_VARIABLE, config['CONFIG'])
  
          if module:
              try:
                  module = import_module(module)
                  config.update({
                      name: getattr(module, name) for name in dir(module)
                      if name == name.upper() and not name.startswith('_')
                  })
  
              except ImportError as exc:
                  config.CONFIG = None
                  self.logger.error("Error importing %s: %s", module, exc)
  
          # Patch configuration from ENV
          for name in config:
              if name.startswith('_') or name != name.upper() or name not in os.environ:
                  continue
              try:
                  config[name] = json.loads(os.environ[name])
              except ValueError:
                  pass
  
          return config
docs: Load the application configuration.
  
          This method loads configuration from python module.