old_contents: import glob
  import imp
  import os
  
  
  class Loader(object):
  
      def __init__(self, project_path):
          self.project_path = project_path
  
      def load(self):
          cur_dir = os.getcwd()
          os.chdir(self.project_path)
          _mod_name = 'acr_commands'
          for management_dir in glob.glob('management'):
              full_path = os.path.abspath(os.path.join(self.project_path, management_dir))
              if not os.path.isdir(full_path):
                  continue
              full_path = os.path.abspath(os.path.join(full_path, _mod_name + '.py'))
              with open(full_path, 'r') as fp:
                  try:
                      mod = imp.find_module(_mod_name, [full_path])
                      if not mod:
                          imp.load_module(_mod_name, fp, full_path, ('.py', 'r', 1))
                  except ImportError:
                      pass
          os.chdir(cur_dir)
  
new_contents: import importlib
  import os
  from pathlib import Path
  
  
  class Loader(object):
  
      def __init__(self, project_path, package_name=None):
          self.project_path = project_path
          self.package_name = package_name
  
      def load(self):
          _mod_name = 'acr_commands'
          for management_dir in Path(self.project_path).glob('*/management'):
              if not management_dir.is_dir():
                  continue
              management_dirs = os.fsdecode(bytes(management_dir)).split(os.sep)
              module_name = '.'.join(management_dirs[-2:])
              if self.package_name:
                  module_name = self.package_name + '.' + module_name
              try:
                  importlib.import_module(module_name + '.' + _mod_name)
              except ImportError:
                  print('Error while importing module: {}'.format(module_name + '.' + _mod_name))
  
subject: use recursive glob