2015-12-15 11 views
11

Hallo, ich bin nach der Anleitung auf den djangoproject site und ich erhalte eine Fehlermeldung auf meinem localhost Spruch:Django Einstellungen Unbekannte Parameter: TEMPLATE_DEBUG

Unknown parameters: TEMPLATE_DEBUG 

Meine settings.py wie folgt aussehen:

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', 
      ], 
     }, 
    }, 
] 

ich habe die ‚TEMPLATE_DEBUG‘ auf TEMPLATE, weil sonst die folgende Warnung ich erhalte

?: (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. 

Meine Vorlagen Ordner in meine apps sind also:

my_project_name/polls/templates/polls/index.html 

Antwort

17

Ich glaube, Sie tun müssen:

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

Django verwendet TEMPLATE_DEBUG Variable zu akzeptieren, aber da Django> = 1,8, ist dies nicht erlaubt mehr und wird wie oben erklärt ersetzt.

Django doc.

+1

Ok ich bekomme es jetzt 'Wenn es TEMPLATE_DEBUG auf einen Wert setzt, der von DEBUG abweicht, schließe diesen Wert unter dem 'Debug' Schlüssel in 'OPTIONS' ein. Danke! –

Verwandte Themen