Sunday, December 13, 2009

Re: HTML text editing

Thanks.

I've solved the problem now. I first just added the {% autoescape off
%} and {% endautoescape %} tags around a block in my 'base.html'
template. I understand that this isn't safe, so I'll have to get find
some solution for this. I'll test Brian's solution below.

Thanks again for your comments!

On Dec 11, 4:51 pm, Shawn Milochik <sh...@milochik.com> wrote:
> Look at safestring.
>
> from django.utils import safestring
>
> The docs will explain all, but basically you do this:
>
> the_html = safestring.mark_safe(your_html)
>
> The text in "the_html," if passed in your template, will not be escaped. The standard warning should be repeated here -- be sure you trust your users, or take measures to prevent the insertion of scripting before you allow anything they enter to be displayed.
>
> Shawn

--

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate