aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index daea751..c95cade 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -4,17 +4,13 @@ Debug Toolbar middleware
from __future__ import unicode_literals
-import imp
import threading
from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils.encoding import force_text
-from django.utils.importlib import import_module
-from django.utils import six
-import debug_toolbar.urls
from debug_toolbar.toolbar.loader import DebugToolbar
from debug_toolbar.utils.settings import CONFIG
@@ -55,8 +51,6 @@ class DebugToolbarMiddleware(object):
debug_toolbars = {}
def __init__(self):
- self._urlconfs = {}
-
# The method to call to decide to show the toolbar
self.show_toolbar = CONFIG['SHOW_TOOLBAR_CALLBACK'] or show_toolbar
@@ -66,26 +60,6 @@ class DebugToolbarMiddleware(object):
def process_request(self, request):
__traceback_hide__ = True # noqa
if self.show_toolbar(request):
- urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
- if isinstance(urlconf, six.string_types):
- urlconf = import_module(getattr(request, 'urlconf', settings.ROOT_URLCONF))
-
- if urlconf not in self._urlconfs:
- new_urlconf = imp.new_module('urlconf')
- new_urlconf.urlpatterns = (debug_toolbar.urls.urlpatterns +
- list(urlconf.urlpatterns))
-
- if hasattr(urlconf, 'handler403'):
- new_urlconf.handler403 = urlconf.handler403
- if hasattr(urlconf, 'handler404'):
- new_urlconf.handler404 = urlconf.handler404
- if hasattr(urlconf, 'handler500'):
- new_urlconf.handler500 = urlconf.handler500
-
- self._urlconfs[urlconf] = new_urlconf
-
- request.urlconf = self._urlconfs[urlconf]
-
toolbar = DebugToolbar(request)
for panel in toolbar.panels:
panel.enabled = panel.dom_id() not in request.COOKIES