def get_model_compat(app_label, model_name):
    try:
        # django >= 1.7
        from django.apps import apps
        return apps.get_model(app_label, model_name)
    except ImportError:
        from django.db.models import get_model
        return get_model(app_label, model_name)
Get a model on multiple Django versions.
dataset/ETHPy150Open django-extensions/django-extensions/django_extensions/compat.py/get_model_compat