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
Serjik
  • 10,543
  • 8
  • 61
  • 70
Papouche Guinslyzinho
  • 5,277
  • 14
  • 58
  • 101

1 Answers1

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.

Alex
  • 5,759
  • 1
  • 32
  • 47
Shang Wang
  • 24,909
  • 20
  • 73
  • 94