Browse Source

build(settings/config.env): choisi s'il faut charger debugtoolbar

la django-debugtoolbar ajoute un overhead important
et n'est pas toujours a propos dans les tests locaux
pull/85/head
Vincent Adolphe 3 years ago
parent
commit
729864a874
  1. 5
      config.env.example
  2. 23
      gaby/settings/development.py

5
config.env.example

@ -78,3 +78,8 @@ @@ -78,3 +78,8 @@
#
# Note that it's always disabled in production.
#DJANGO_DEBUG=off
# Turn on/off django debug toolbar.
#
# Note that it has no effect in production.
#DEBUG_TOOLBAR=off

23
gaby/settings/development.py

@ -30,22 +30,25 @@ vars().update(env.email_url('DJANGO_EMAIL_URL', default='consolemail://')) @@ -30,22 +30,25 @@ vars().update(env.email_url('DJANGO_EMAIL_URL', default='consolemail://'))
# DJANGO DEBUG TOOLBAR
# ------------------------------------------------------------------------------
# https://django-debug-toolbar.readthedocs.io/en/stable/installation.html
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware'] # noqa: F405
INSTALLED_APPS += ['debug_toolbar', 'django_extensions'] # noqa: F405
if env.bool('DEBUG_TOOLBAR', default=False):
MIDDLEWARE += [ # noqa: F405c
'debug_toolbar.middleware.DebugToolbarMiddleware'
]
INSTALLED_APPS += ['debug_toolbar'] # noqa: F405
INTERNAL_IPS = ['127.0.0.1']
INTERNAL_IPS = ['127.0.0.1']
DEBUG_TOOLBAR_CONFIG = {
'DISABLE_PANELS': ['debug_toolbar.panels.redirects.RedirectsPanel'],
'SHOW_TEMPLATE_CONTEXT': True,
# Uncomment if jQuery is already loaded by your assets:
# 'JQUERY_URL': '',
}
DEBUG_TOOLBAR_CONFIG = {
'DISABLE_PANELS': ['debug_toolbar.panels.redirects.RedirectsPanel'],
'SHOW_TEMPLATE_CONTEXT': True,
# Uncomment if jQuery is already loaded by your assets:
# 'JQUERY_URL': '',
}
# DJANGO EXTENSIONS
# ------------------------------------------------------------------------------
# https://django-extensions.readthedocs.io/en/stable/index.html
# INSTALLED_APPS += ['django_extensions'] # noqa: F405
INSTALLED_APPS += ['django_extensions'] # noqa: F405
LOGGING = {
'version': 1,

Loading…
Cancel
Save
Map all the world