I'm getting following warning when using Django 1.8:
?: (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_STRING_IF_INVALID.
I'm using settings from Django 1.7. Where should the TEMPLATE_STRING_IF_INVALID go exactly in Django 1.8?
Remove TEMPLATE_STRING_IF_INVALID = 'Invalid: %s' or similar from the settings and add string_if_invalid to the options of the new TEMPLATES setting:
DEBUG = False
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
],
'debug': DEBUG,
'string_if_invalid': 'Invalid: "%s"'
},
},
]
Alternatively if you're using a production and a development settings file, add following statement to the development settings file:
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
TEMPLATES[0]['OPTIONS']['context_processors'].append('django.template.context_processors.debug')
TEMPLATES[0]['OPTIONS']['string_if_invalid'] = 'Invalid: "%s"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With