aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--debug_toolbar/models.py4
-rw-r--r--debug_toolbar/toolbar.py14
-rw-r--r--docs/contributing.rst3
4 files changed, 19 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b100b8d..0e8959a 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ coverage:
coverage html
translatable_strings:
- cd debug_toolbar && django-admin.py makemessages -l en --no-wrap --no-obsolete
+ cd debug_toolbar && django-admin.py makemessages -l en --no-obsolete
@echo "Please commit changes and run 'tx push -s' (or wait for Transifex to pick them)"
update_translations:
diff --git a/debug_toolbar/models.py b/debug_toolbar/models.py
index c9a12d8..4e624fa 100644
--- a/debug_toolbar/models.py
+++ b/debug_toolbar/models.py
@@ -51,9 +51,9 @@ def patch_root_urlconf():
reverse('djdt:render_panel')
except NoReverseMatch:
urlconf_module = import_module(settings.ROOT_URLCONF)
- urlconf_module.urlpatterns += patterns('', # noqa
+ urlconf_module.urlpatterns = patterns('', # noqa
url(r'^__debug__/', include(debug_toolbar.urls)),
- )
+ ) + urlconf_module.urlpatterns
clear_url_caches()
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index 82851b3..ec840dd 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -6,8 +6,10 @@ 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 import TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils.importlib import import_module
try:
@@ -60,7 +62,17 @@ class DebugToolbar(object):
"""
if not self.should_render_panels():
self.store()
- return render_to_string('debug_toolbar/base.html', {'toolbar': self})
+ try:
+ context = {'toolbar': self}
+ return render_to_string('debug_toolbar/base.html', context)
+ except TemplateSyntaxError:
+ if 'django.contrib.staticfiles' not in settings.INSTALLED_APPS:
+ raise ImproperlyConfigured(
+ "The debug toolbar requires the staticfiles contrib app. "
+ "Add 'django.contrib.staticfiles' to INSTALLED_APPS and "
+ "define STATIC_URL in your settings.")
+ else:
+ raise
# Handle storing toolbars in memory and fetching them later on
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 8a45b1a..0754010 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -120,3 +120,6 @@ The release itself requires the following steps:
packages install correctly before uploading them. (How?)
#. Push the commit and the tag.
+
+#. Change the default version of the docs to point to the latest release:
+ https://readthedocs.org/dashboard/django-debug-toolbar/versions/