try:
    from django.apps.registry import apps

    # Django >= 1.7
    get_apps = apps.get_apps
    cache = None
except ImportError:
    from django.db.models.loading import cache

    # Django < 1.7
    get_apps = cache.get_apps
    apps = None


def get_app(app_label, emptyOK=False):
    """Return the app with the given label.

    This returns the app from the app registry on Django >= 1.7, and from
    the old-style cache on Django < 1.7.

    The ``emptyOK`` argument is ignored for Django >= 1.7.
    """
    if apps:
        return get_app(app_label)
    else:
        return get_app(app_label, emptyOK)


__all__ = ['get_app', 'get_apps']

try:
    from django.apps.registry import apps

    get_apps = apps.get_apps
    cache = None
except ImportError:
    from django.db.models.loading import cache

    get_apps = cache.get_apps
    apps = None


def get_app(app_label, emptyOK=False):
    """Return the app with the given label.

    This returns the app from the app registry on Django >= 1.7, and from
    the old-style cache on Django < 1.7.

    The ``emptyOK`` argument is ignored for Django >= 1.7.
    """
    if apps:
        return apps.get_app(app_label)
    else:
        return apps.get_app(app_label, emptyOK)


__all__ = ['get_app', 'get_apps']

--- 
+++ 
@@ -1,11 +1,13 @@
 try:
     from django.apps.registry import apps
 
+    # Django >= 1.7
     get_apps = apps.get_apps
     cache = None
 except ImportError:
     from django.db.models.loading import cache
 
+    # Django < 1.7
     get_apps = cache.get_apps
     apps = None
 
@@ -19,9 +21,9 @@
     The ``emptyOK`` argument is ignored for Django >= 1.7.
     """
     if apps:
-        return apps.get_app(app_label)
+        return get_app(app_label)
     else:
-        return apps.get_app(app_label, emptyOK)
+        return get_app(app_label, emptyOK)
 
 
 __all__ = ['get_app', 'get_apps']
Fix the new get_app compatibility function.

The get_app compatibility function was trying to call get_apps() on
the apps variable, instead of calling the extracted version that was
pre-computed. Now it uses the correct versions.
