def load_model_class(model_path):
 dot = model_path.rindex('.')
 module_name = model_path[:dot]
 class_name = model_path[(dot + 1):]
 try:
  _class = getattr(import_module(module_name), class_name)
  return _class
 except (ImportError, AttributeError):
  raise ImproperlyConfigured(('%s cannot be imported' % model_path))

def load_model_class ( model_path ) : dot = model_path . rindex ( '.' ) module_name = model_path [ : dot ] class_name = model_path [ ( dot + 1 ) : ] try : _class = getattr ( import_module ( module_name ) , class_name ) return _class except ( ImportError , AttributeError ) : raise ImproperlyConfigured ( ( '%s cannot be imported' % model_path ) )
load by import a class by a string path like: module .