mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-14 02:03:11 +00:00
Removed Django 1.6 support from utils/apps.py
This commit is contained in:
parent
6c8981792e
commit
47713c128c
1 changed files with 4 additions and 16 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue