From 2f6666d77fe28366635c1619b0b0f4d66996b3d3 Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Thu, 21 May 2015 16:50:43 -0700 Subject: [PATCH] work with AppConfigs in INSTALLED_APPS --- django_medusa/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django_medusa/utils.py b/django_medusa/utils.py index e276d12..5423314 100644 --- a/django_medusa/utils.py +++ b/django_medusa/utils.py @@ -23,9 +23,14 @@ def get_static_renderers(): # INSTALLED_APPS that aren't the project itself (also ignoring this # django_medusa module) + try: + from django.apps import apps + installed_apps = [app.module.__name__ for app in apps.get_app_configs()] + except ImportError: # Fallback for Django < 1.7 + installed_apps = settings.INSTALLED_APPS modules_to_check += filter( lambda x: (x != "django_medusa") and (x != settings_module), - settings.INSTALLED_APPS + installed_apps ) for app in modules_to_check: