]> git.parisson.com Git - teleforma.git/commitdiff
fix debug toolbar
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 3 Jan 2023 13:06:51 +0000 (14:06 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 3 Jan 2023 13:09:11 +0000 (14:09 +0100)
app/settings.py
app/urls.py

index 97f8ef63258666175f644b7e53d3da2e33b5b12d..95526b1b7e01be16d68dd8b94db6f850909d543a 100644 (file)
@@ -13,6 +13,7 @@ sys.dont_write_bytecode = True
 
 DEBUG_ENV = os.environ.get('DEBUG') == 'True'
 DEBUG = DEBUG_ENV
+DEBUG_TOOLBAR = False
 TEMPLATE_DEBUG = DEBUG
 
 RECOVERY = False
@@ -163,7 +164,7 @@ TEMPLATE_LOADERS = (
     )),
 )
 
-MIDDLEWARE = (('debug_toolbar.middleware.DebugToolbarMiddleware',) if DEBUG else ()) + (
+MIDDLEWARE = (('debug_toolbar.middleware.DebugToolbarMiddleware',) if DEBUG_TOOLBAR else ()) + (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
@@ -204,7 +205,7 @@ INSTALLED_APPS = (
 )
 
 
-if DEBUG:
+if DEBUG_TOOLBAR:
     INSTALLED_APPS += ('debug_toolbar',)
 
 TEMPLATES = [
@@ -509,7 +510,7 @@ SHERLOKS_USE_TRANSACTION_ID = True
 
 ORAL_OPTION_PRICE = 250
 
-if DEBUG:
+if DEBUG_TOOLBAR:
     def show_toolbar(request):
         return True
     DEBUG_TOOLBAR_CONFIG = {
index e601f98dd207734c4f089f131212beb70f39c44a..7f365327ee2794cc961cbaf787248e2d124e054e 100644 (file)
@@ -2,6 +2,7 @@
 import os
 
 from django.conf.urls import include, url
+from django.conf import settings
 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 from django.http import HttpResponse
@@ -11,9 +12,7 @@ admin.autodiscover()
 
 js_info_dict = ['teleforma']
 
-DEBUG_ENV = os.environ.get('DEBUG') == 'True'
-
-if DEBUG_ENV:
+if settings.DEBUG_TOOLBAR:
     import debug_toolbar
 
 urlpatterns = [
@@ -38,5 +37,5 @@ urlpatterns = [
     #url(r'^pdfviewer/', include('webviewer.urls')),
     url(r'^pdfannotator/', include('pdfannotator.urls')),
     url(r'^messages/', include('postman.urls', namespace='postman')),
-] + ([url(r'^__debug__/', include(debug_toolbar.urls)),] if DEBUG_ENV else [])
+] + ([url(r'^__debug__/', include(debug_toolbar.urls)),] if settings.DEBUG_TOOLBAR else [])