Removed Django 1.6 support from utils/apps.py

This commit is contained in:
Karl Hobley 2014-12-15 21:21:30 +00:00
parent 6c8981792e
commit 47713c128c

View file

@ -1,11 +1,6 @@
try:
from importlib import import_module
except ImportError:
# for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7)
from django.utils.importlib import import_module
from importlib import import_module
import django
from django.conf import settings
from django.apps import apps
from django.utils.module_loading import module_has_submodule
@ -14,15 +9,8 @@ def get_app_modules():
Generator function that yields a module object for each installed app
yields tuples of (app_name, module)
"""
if django.VERSION < (1, 7):
# Django 1.6
for app in settings.INSTALLED_APPS:
yield app, import_module(app)
else:
# Django 1.7+
from django.apps import apps
for app in apps.get_app_configs():
yield app.name, app.module
for app in apps.get_app_configs():
yield app.name, app.module
def get_app_submodules(submodule_name):