diff --git a/common/lib/capa/capa/customrender.py b/common/lib/capa/capa/customrender.py
index 255adfa29b..e0a3e05aa6 100644
--- a/common/lib/capa/capa/customrender.py
+++ b/common/lib/capa/capa/customrender.py
@@ -11,8 +11,8 @@ from __future__ import absolute_import
import logging
import re
import xml.sax.saxutils as saxutils
-from cgi import escape as cgi_escape
+from django.utils import html
from lxml import etree
from .registry import TagRegistry
@@ -126,9 +126,10 @@ class TargetedFeedbackRenderer(object):
Return the contents of this tag, rendered to html, as an etree element.
"""
# xss-lint: disable=python-wrap-html
- html = '
Failed to construct targeted feedback from
{html}