Search code examples
djangounicodequotesrender-to-string

can't encode single quote (') using django's render_to_string


i have a problem with django's render_to_string and encoding single quotes.

... = render_to_string('dummy.txt', {'request':request, 'text':text,}, context_instance=RequestContext(request)))

why are only these quotes translated to '#39;' and all other special characters not?


Solution

  • Automatic escaping. Link now changed to https://code.djangoproject.com/wiki/AutoEscaping