Django settings Unknown parameters: TEMPLATE_DEBUG
Asked Answered
S

1

12

Hi I'm following the tutorial on the djangoproject site and I'm getting an error on my localhost saying:

Unknown parameters: TEMPLATE_DEBUG

My settings.py looks like this:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'TEMPLATE_DEBUG':True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

I added the 'TEMPLATE_DEBUG' on TEMPLATE because otherwise I'm getting the following warning

?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.

My templates folder are in my apps i.e.:

my_project_name/polls/templates/polls/index.html
Swordtail answered 15/12, 2015 at 20:32 Comment(0)
C
18

I think you need to do:

DEBUG = True 

TEMPLATES = [
    {
        # something else
        'OPTIONS': {
            'debug': DEBUG,
        },
    },
]

Django used to accept TEMPLATE_DEBUG variable but since Django >= 1.8, this not allowed any more and is replaced as explained above.

Django doc.

Clericals answered 15/12, 2015 at 20:38 Comment(1)
Ok I get it now If it sets TEMPLATE_DEBUG to a value that differs from DEBUG, include that value under the 'debug' key in 'OPTIONS'. Thanks!Swordtail

© 2022 - 2024 — McMap. All rights reserved.