From 5bc5c9d9bc63790d8f4cd4ecba86daa850d05a75 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Sun, 24 May 2015 13:37:30 +0200 Subject: [PATCH] Show debug toolbar to all incoming requests --- project/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/project/settings.py b/project/settings.py index 635a478..79fb39d 100644 --- a/project/settings.py +++ b/project/settings.py @@ -120,3 +120,15 @@ USE_TZ = True STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') + + +# Django Debug Toolbar settings + +DEBUG_TOOLBAR_CONFIG = { + 'SHOW_TOOLBAR_CALLBACK': 'project.settings.show_debug_toolbar', +} + +def show_debug_toolbar(request): + if request.is_ajax(): + return False + return bool(DEBUG)