From 1c1b4428642254f4e6b05e93bd135b894f708eeb Mon Sep 17 00:00:00 2001
From: Aymeric Augustin
Date: Sun, 24 Nov 2013 12:05:28 +0100
Subject: Take advantage of django.contrib.staticfiles to serve static files.
It is the de facto standard nowadays and there's no good reason not to use it.
---
debug_toolbar/templates/debug_toolbar/base.html | 8 ++++----
debug_toolbar/templates/debug_toolbar/panels/profiling.html | 5 ++---
debug_toolbar/templates/debug_toolbar/panels/sql.html | 4 ++--
debug_toolbar/templates/debug_toolbar/panels/templates.html | 4 ++--
debug_toolbar/templates/debug_toolbar/panels/timer.html | 4 ++--
debug_toolbar/toolbar.py | 6 +-----
6 files changed, 13 insertions(+), 18 deletions(-)
(limited to 'debug_toolbar')
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index 8a5e070..a9d82dc 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -1,13 +1,13 @@
-{% load i18n %}{% load url from future %}
+{% load i18n %}{% load static from staticfiles %}{% load url from future %}
-
+
-
-
+
+
diff --git a/debug_toolbar/templates/debug_toolbar/panels/profiling.html b/debug_toolbar/templates/debug_toolbar/panels/profiling.html
index 34ecc87..9d34043 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/profiling.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/profiling.html
@@ -1,5 +1,4 @@
-{% load i18n %}
-
+{% load i18n %}{% load static from staticfiles %}
-
+
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 33c496c..599f194 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -1,4 +1,4 @@
-{% load i18n l10n %}{% load url from future %}
+{% load i18n l10n %}{% load static from staticfiles %}{% load url from future %}
-
+
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index de9d69d..d50ad52 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -6,7 +6,6 @@ from __future__ import absolute_import, unicode_literals
import uuid
-from django.conf import settings
from django.conf.urls import patterns, url
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string
@@ -21,10 +20,7 @@ class DebugToolbar(object):
def __init__(self, request):
self.request = request
self.config = dt_settings.CONFIG.copy()
- self.template_context = {
- 'STATIC_URL': settings.STATIC_URL,
- 'toolbar': self,
- }
+ self.template_context = {'toolbar': self}
self._panels = SortedDict()
for panel_class in self.get_panel_classes():
panel_instance = panel_class(self, context=self.template_context)
--
cgit v1.2.3