aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar')
-rw-r--r--debug_toolbar/panels/staticfiles.py8
-rw-r--r--debug_toolbar/toolbar.py10
2 files changed, 9 insertions, 9 deletions
diff --git a/debug_toolbar/panels/staticfiles.py b/debug_toolbar/panels/staticfiles.py
index efaf841..daf8909 100644
--- a/debug_toolbar/panels/staticfiles.py
+++ b/debug_toolbar/panels/staticfiles.py
@@ -6,7 +6,6 @@ except ImportError:
threading = None
from django.conf import settings
-from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import get_storage_class
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.templatetags import staticfiles
@@ -102,13 +101,6 @@ class StaticFilesPanel(panels.Panel):
storage.staticfiles_storage = staticfiles.staticfiles_storage = _original_storage
@property
- def has_content(self):
- if "django.contrib.staticfiles" not in settings.INSTALLED_APPS:
- raise ImproperlyConfigured("Could not find staticfiles in "
- "INSTALLED_APPS setting.")
- return True
-
- @property
def num_used(self):
return len(self._paths[threading.currentThread()])
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index 53b3182..03d4b7c 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -6,6 +6,7 @@ from __future__ import absolute_import, unicode_literals
import uuid
+import django
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.exceptions import ImproperlyConfigured
@@ -66,7 +67,14 @@ class DebugToolbar(object):
context = {'toolbar': self}
return render_to_string('debug_toolbar/base.html', context)
except TemplateSyntaxError:
- if 'django.contrib.staticfiles' not in settings.INSTALLED_APPS:
+ if django.VERSION[:2] >= (1, 7):
+ from django.apps import apps
+ staticfiles_installed = apps.is_installed(
+ 'django.contrib.staticfiles')
+ else:
+ staticfiles_installed = ('django.contrib.staticfiles'
+ in settings.INSTALLED_APPS)
+ if not staticfiles_installed:
raise ImproperlyConfigured(
"The debug toolbar requires the staticfiles contrib app. "
"Add 'django.contrib.staticfiles' to INSTALLED_APPS and "