I'd either do one of 2 things:
insert import pdb; pdb.set_trace()
at the middleware _show_toolbar
method and see which item it fails on, or pepper the middleware with print statements to see which check it failed on, whichever you're more comfortable with.
def _show_toolbar(self, request, response=None):
if not settings.DEBUG or not getattr(settings, 'DEBUG_TOOLBAR', True) or getattr(settings, 'TEST', False):
return False
if request.path.startswith(settings.MEDIA_URL):
return False
if response:
if getattr(response, 'skip_debug_response', False):
return False
if response.status_code >= 300 and response.status_code < 400:
return False
# Allow access if remote ip is in INTERNAL_IPS or
# the user doing the request is logged in as super user.
if (not request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS and
(not request.user.is_authenticated() or not request.user.is_superuser)):
return False
return True