File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import uuid
8
8
9
+ from django .conf import settings
9
10
from django .conf .urls import patterns , url
10
11
from django .core .exceptions import ImproperlyConfigured
12
+ from django .template import TemplateSyntaxError
11
13
from django .template .loader import render_to_string
12
14
from django .utils .datastructures import SortedDict
13
15
from django .utils .importlib import import_module
@@ -57,7 +59,17 @@ def render_toolbar(self):
57
59
"""
58
60
if not self .should_render_panels ():
59
61
self .store ()
60
- return render_to_string ('debug_toolbar/base.html' , {'toolbar' : self })
62
+ try :
63
+ context = {'toolbar' : self }
64
+ return render_to_string ('debug_toolbar/base.html' , context )
65
+ except TemplateSyntaxError :
66
+ if 'django.contrib.staticfiles' not in settings .INSTALLED_APPS :
67
+ raise ImproperlyConfigured (
68
+ "The debug toolbar requires the staticfiles contrib app. "
69
+ "Add 'django.contrib.staticfiles' to INSTALLED_APPS and "
70
+ "define STATIC_URL in your settings." )
71
+ else :
72
+ raise
61
73
62
74
# Handle storing toolbars in memory and fetching them later on
63
75
You can’t perform that action at this time.
0 commit comments