I have string_if_invalid
set to 'INVALID' in my django template settings.
And there is some template that looks like this:
{{ some_nonexisting_value|default:'Default value' }}
After rendering result looks like 'INVALID'
. So, default value is not used.
Is there any way to make string_if_invalid
to work with default values without changing templates?
Edit: Template settings look like this:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'OPTIONS': {
'libraries': {
'utm_tags': 'kurator.templatetags.utm_tags',
},
'string_if_invalid': 'INVALID',
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'kurator.context_processors.static_hash',
'kurator.context_processors.debug',
]
},
},
]