Output raw HTML to template

142 views
Skip to first unread message

asdfg

unread,
May 26, 2011, 11:17:21 AM5/26/11
to django-...@googlegroups.com
I've got a Textarea placeholder in my template that will be used to paste a YouTube iframe embed link into.

Obviously I want this to be output in the template as raw HTML but as soon as I save the page in the admin, it converts the angle brackets into their character entity equivalents.

I can't seem to find a way round this. Is there something I'm missing...?

Hamish Gough

unread,
May 26, 2011, 3:48:14 PM5/26/11
to django-...@googlegroups.com
Are you using something like TinyMCE or WYMEditor for the widget? Maybe
just try placeholder foo with TextArea to get plain text - youll need to
use fialedname|safe for the output in your template as well, to stop it
from being escaped.

asdfg

unread,
May 27, 2011, 3:44:18 AM5/27/11
to django-...@googlegroups.com
No, I'm just using a plain old Textarea, but the encoding is happening as soon as I hit save, so template tags/filters have no effect.

asdfg

unread,
May 31, 2011, 4:41:21 AM5/31/11
to django-...@googlegroups.com
Anyone able to shed any more light on this?

asdfg

unread,
May 31, 2011, 4:53:31 AM5/31/11
to django-...@googlegroups.com
Ah, such a simple answer in the end! The PAGE_SANITIZE_USER_INPUT setting needed changing to False.
Reply all
Reply to author
Forward
0 new messages