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 66
77import uuid
88
9+ from django .conf import settings
910from django .conf .urls import patterns , url
1011from django .core .exceptions import ImproperlyConfigured
12+ from django .template import TemplateSyntaxError
1113from django .template .loader import render_to_string
1214from django .utils .datastructures import SortedDict
1315from django .utils .importlib import import_module
@@ -57,7 +59,17 @@ def render_toolbar(self):
5759 """
5860 if not self .should_render_panels ():
5961 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
6173
6274 # Handle storing toolbars in memory and fetching them later on
6375
You can’t perform that action at this time.
0 commit comments