def get_model_class_from_string(model_path):
try:<EOL><INDENT>app_name, model_name = model_path.split('<STR_LIT:.>')<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ImproperlyConfigured('<STR_LIT>' % model_path)<EOL><DEDENT>if apps_get_model is None:<EOL><INDENT>model = get_model(app_name, model_name)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>model = apps_get_model(app_name, model_name)<EOL><DEDENT>except (LookupError, ValueError):<EOL><INDENT>model = None<EOL><DEDENT><DEDENT>if model is None:<EOL><INDENT>raise ImproperlyConfigured('<STR_LIT>' % (model_path, model_name))<EOL><DEDENT>return model<EOL>
Returns a certain model as defined in a string formatted `<app_name>.<model_name>`.

    Example:

        model = get_model_class_from_string('myapp.MyModel')