How do I modify the HttpResponse object in django ?

Posted by Rohit on Stack Overflow See other posts from Stack Overflow or by Rohit
Published on 2009-12-22T13:34:51Z Indexed on 2010/03/29 12:03 UTC
Read the original article Hit count: 351

I need the html returned using render_to_response to be escaped. I am unable to find any suitable documentation. Can someone point in some direction ?

the code is :

return render_to_response(template_name, {return render_to_response(template_name, {
            'form': form,
            redirect_field_name: redirect_to,
            'site': current_site,
            'site_name': current_site.name,
        }, context_instance=RequestContext(request))

Here I need the response html text to be escaped. I way I know is reading template file in string and escaping it with re.escape() and then rendering it. whats a cleaner and simpler way to do that ??

© Stack Overflow or respective owner

Related posts about django

Related posts about django-template