def app_label_to_app_module(app_label):
 app = models.get_app(app_label)
 module_name = '.'.join(app.__name__.split('.')[:(-1)])
 try:
  module = sys.modules[module_name]
 except KeyError:
  __import__(module_name, {}, {}, [''])
  module = sys.modules[module_name]
 return module

def app_label_to_app_module ( app_label ) : app = models . get_app ( app_label ) module_name = '.' . join ( app . __name__ . split ( '.' ) [ : ( - 1 ) ] ) try : module = sys . modules [ module_name ] except KeyError : __import__ ( module_name , { } , { } , [ '' ] ) module = sys . modules [ module_name ] return module
given the app label .