Complete worked example
python
from bootstrap_lab import django_setup
django_setup(__name__)
from django.template import Context, Template
from django.utils.safestring import mark_safe
def rendered_title(title):
template = Template("{{ title }}")
return template.render(Context({"title": title}))- Reasoning
- The worked template places title into an automatically escaped variable position. Django escapes reserved HTML characters while ordinary text remains readable.