can't encode single quote (') using django's render_to_string Automatic escaping. Link now changed to https://code.djangoproject.com/wiki/AutoEscaping