From 87a8acbae22b1e5fd4ad66b3ac637a4ac2077f2b Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Thu, 20 Jun 2019 23:35:46 +0800 Subject: [PATCH] Remove redundant template debug setting > 'debug': a boolean that turns on/off template debug mode. If it is > True, the fancy error page will display a detailed report for any > exception raised during template rendering. This report contains the > relevant snippet of the template with the appropriate line highlighted. > It defaults to the value of the DEBUG setting. https://docs.djangoproject.com/en/2.2/topics/templates/#module-django.template.backends.django I could be wrong about this, but it seems like setting the template DEBUG setting is redundant, since it should follow whatever the DEBUG variable is set to. --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/config/settings/base.py | 2 -- {{cookiecutter.project_slug}}/config/settings/local.py | 5 ----- {{cookiecutter.project_slug}}/config/settings/test.py | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index bb519613..5a650b90 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -89,6 +89,7 @@ Listed in alphabetical order. Cullen Rhodes `@c-rhodes`_ Curtis St Pierre `@curtisstpierre`_ @cstpierre1388 Dan Shultz `@shultz`_ + Dani Hodovic `@danihodovic` Daniel Hepper `@dhepper`_ @danielhepper Daniele Tricoli `@eriol`_ David Díaz `@ddiazpinto`_ @DavidDiazPinto @@ -238,6 +239,7 @@ Listed in alphabetical order. .. _@Collederas: https://github.com/Collederas .. _@curtisstpierre: https://github.com/curtisstpierre .. _@dadokkio: https://github.com/dadokkio +.. _@danihodovic: https://github.com/danihodovic .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto .. _@delneg: https://github.com/delneg diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 2745058d..4ffa5021 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -171,8 +171,6 @@ TEMPLATES = [ # https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs "DIRS": [str(APPS_DIR.path("templates"))], "OPTIONS": { - # https://docs.djangoproject.com/en/dev/ref/settings/#template-debug - "debug": DEBUG, # https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders # https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types "loaders": [ diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 0c0588bd..bbc9ab35 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -23,11 +23,6 @@ CACHES = { } } -# TEMPLATES -# ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405 - # EMAIL # ------------------------------------------------------------------------------ {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%} diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 2ade134a..35e1a010 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -34,8 +34,6 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] # TEMPLATES # ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405 TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 ( "django.template.loaders.cached.Loader",