The following code in one of my views returns unescaped html string which cannot be parsed in frontend since it is an Ajax request.
return render_to_response
It should escape by default.
But, if you want to, you can explicitly force escaping.
from django.utils.safestring import mark_for_escaping return HttpResponse(mark_for_escaping(loader.render_to_string(""""Render Response Syntax"""))