As of Django
2.1 django.utils.translation.string_concat()
has been removed and marked as deprecated in earlier versions.
In order to evaluate lazy objects in a str.format()
like syntax you now have to use format_lazy()
instead.
Example:
my_field = forms.BooleanField(
# ...
help_text=format_lazy(
'''
Please click <a href='{}'>here</a>.
''',
reverse_lazy('my-viewname')
)
)
Note that you may have to explicitly mark the help_text
content as safe for HTML output purposes. A possible solution to do so could be within the template and the help of the safe filter:
{{ my_field|safe }}