File tree 7 files changed +19
-19
lines changed
7 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
- {% load i18n %}{% load url from future %}
1
+ {% load i18n %}{% load static from staticfiles %}{% load url from future %}
2
2
< style type ="text/css ">
3
3
@media print { # djDebug {display : none;}}
4
4
</ style >
5
- < link rel ="stylesheet " href ="{{ STATIC_URL }} debug_toolbar/css/toolbar.css " type ="text/css " />
5
+ < link rel ="stylesheet " href ="{% static ' debug_toolbar/css/toolbar.css' %} " type ="text/css " />
6
6
< script > //<![CDATA[
7
7
if ( ! window . jQuery ) document . write ( '<scr' + 'ipt src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></scr' + 'ipt>' ) ;
8
8
//]]> </ script >
9
- < script src ="{{ STATIC_URL }} debug_toolbar/js/jquery.cookie.js "> </ script >
10
- < script src ="{{ STATIC_URL }} debug_toolbar/js/toolbar.js "> </ script >
9
+ < script src ="{% static ' debug_toolbar/js/jquery.cookie.js' %} "> </ script >
10
+ < script src ="{% static ' debug_toolbar/js/toolbar.js' %} "> </ script >
11
11
< div id ="djDebug " style ="display:none; " dir ="ltr "
12
12
data-store-id ="{{ toolbar.store_id }} " data-render-panel-url ="{% url 'djdt:render_panel' %} "
13
13
{{ toolbar.config.ROOT_TAG_EXTRA_ATTRS|safe }} >
Original file line number Diff line number Diff line change 1
- {% load i18n %}
2
-
1
+ {% load i18n %}{% load static from staticfiles %}
3
2
< table width ="100% ">
4
3
< thead >
5
4
< tr >
42
41
</ tbody >
43
42
</ table >
44
43
45
- < script src ="{{ STATIC_URL }} debug_toolbar/js/toolbar.profiling.js "> </ script >
44
+ < script src ="{% static ' debug_toolbar/js/toolbar.profiling.js' %} "> </ script >
Original file line number Diff line number Diff line change 1
- {% load i18n l10n %}{% load url from future %}
1
+ {% load i18n l10n %}{% load static from staticfiles %}{% load url from future %}
2
2
< div class ="clearfix ">
3
3
< ul class ="stats ">
4
4
{% for alias, info in databases %}
92
92
< p > {% trans "No SQL queries were recorded during this request." %}</ p >
93
93
{% endif %}
94
94
95
- < script src ="{{ STATIC_URL }} debug_toolbar/js/toolbar.sql.js "> </ script >
95
+ < script src ="{% static ' debug_toolbar/js/toolbar.sql.js' %} "> </ script >
Original file line number Diff line number Diff line change 1
- {% load i18n %}{% load url from future %}
1
+ {% load i18n %}{% load static from staticfiles %}{% load url from future %}
2
2
< h4 > {% blocktrans count template_dirs|length as template_count %}Template path{% plural %}Template paths{% endblocktrans %}</ h4 >
3
3
{% if template_dirs %}
4
4
< ol >
@@ -43,4 +43,4 @@ <h4>{% blocktrans count context_processors|length as context_processors_count %}
43
43
< p > {% trans 'None' %}</ p >
44
44
{% endif %}
45
45
46
- < script src ="{{ STATIC_URL }} debug_toolbar/js/toolbar.template.js "> </ script >
46
+ < script src ="{% static ' debug_toolbar/js/toolbar.template.js' %} "> </ script >
Original file line number Diff line number Diff line change 1
- {% load i18n %}
1
+ {% load i18n %}{% load static from staticfiles %}
2
2
< h4 > {% trans 'Resource Usage' %}</ h4 >
3
3
< table >
4
4
< colgroup >
@@ -41,4 +41,4 @@ <h4>{% trans 'Browser Timing' %}</h4>
41
41
</ tbody >
42
42
</ table >
43
43
</ div >
44
- < script src ="{{ STATIC_URL }} debug_toolbar/js/toolbar.timer.js "> </ script >
44
+ < script src ="{% static ' debug_toolbar/js/toolbar.timer.js' %} "> </ script >
Original file line number Diff line number Diff line change 6
6
7
7
import uuid
8
8
9
- from django .conf import settings
10
9
from django .conf .urls import patterns , url
11
10
from django .core .exceptions import ImproperlyConfigured
12
11
from django .template .loader import render_to_string
@@ -21,10 +20,7 @@ class DebugToolbar(object):
21
20
def __init__ (self , request ):
22
21
self .request = request
23
22
self .config = dt_settings .CONFIG .copy ()
24
- self .template_context = {
25
- 'STATIC_URL' : settings .STATIC_URL ,
26
- 'toolbar' : self ,
27
- }
23
+ self .template_context = {'toolbar' : self }
28
24
self ._panels = SortedDict ()
29
25
for panel_class in self .get_panel_classes ():
30
26
panel_instance = panel_class (self , context = self .template_context )
Original file line number Diff line number Diff line change @@ -22,13 +22,18 @@ instead with the following command::
22
22
Quick setup
23
23
-----------
24
24
25
- Add ``debug_toolbar `` to your ``INSTALLED_APPS `` setting::
25
+ Make sure that ``'django.contrib.staticfiles' `` is set up properly and add
26
+ ``'debug_toolbar' `` to your ``INSTALLED_APPS `` setting::
26
27
27
28
INSTALLED_APPS = (
29
+ # ...
30
+ 'django.contrib.staticfiles',
28
31
# ...
29
32
'debug_toolbar',
30
33
)
31
34
35
+ STATIC_URL = '/static/'
36
+
32
37
For a simple Django project, that's all you need!
33
38
34
39
The Debug Toolbar will automatically adjust a few settings when you start the
You can’t perform that action at this time.
0 commit comments