On Mon, Apr 27, 2009 at 9:12 PM, Renato Untalan <phis...@gmail.com> wrote:
>
> Hey guys,
>
> In my current project, I'm making a soap call to a remote server,
> which will return to me a Django template.
> Once I have the Django template, I insert it into my Context object,
> and when it renders, it renders the template in plain text, and does
> not show any of the HTML tags.
>
> My context object's dictionary:
> myVars = { "custom_settings_template" : connector_template }
>
> My template:
>
> <!--- insert custom template --->
> {{ connector_template }}

I think you need the "safe" template filter there [1]:

{{ connector_template|safe }}

Beware of the html you are injecting from the soap call, the safe
filter will let it pass unmodified. Maybe you can chain "safe" with
the filter "removetags" [2] to get rid of potentially dangerous html
tags.

[1] http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe
[2] http://docs.djangoproject.com/en/dev/ref/templates/builtins/#removetags

Regards.

-- 
Marcelo Ramos
Django/Python developer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to