From 4225671177f9f65e873ddbab373e5968c2afa8fc Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Dec 2013 12:43:49 +0100 Subject: Fix staticfiles panel to work with prefixed STATICFILES_DIRS. Closes #503 and #507. Many thanks to Alexander Clausen (@sk1p) for the inspiration for the patch. --- debug_toolbar/panels/staticfiles.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/panels') diff --git a/debug_toolbar/panels/staticfiles.py b/debug_toolbar/panels/staticfiles.py index f212f2b..efaf841 100644 --- a/debug_toolbar/panels/staticfiles.py +++ b/debug_toolbar/panels/staticfiles.py @@ -163,8 +163,11 @@ class StaticFilesPanel(panels.Panel): """ Returns a list of paths to inspect for additional static files """ - dirs = getattr(settings, 'STATICFILES_DIRS', ()) - return [normpath(d) for d in dirs] + dirs = [] + for finder in finders.get_finders(): + if isinstance(finder, finders.FileSystemFinder): + dirs.extend(finder.locations) + return [(prefix, normpath(dir)) for prefix, dir in dirs] def get_staticfiles_apps(self): """ -- cgit v1.2.3