Re: render_to_response a HTML msg

2011-03-10 Thread Bill Freeman
On Thu, Mar 10, 2011 at 12:14 PM, Tom Evans wrote: > 2011/3/10 Thiago Carvalho D' Ávila : >> Oh, thanks a lot. That worked, but now I have one more doubt... >> >> What are the security issues related to the use of safe variable? When can I >> consider it safe? Is it possible to make some kind of i

Re: render_to_response a HTML msg

2011-03-10 Thread Tom Evans
2011/3/10 Thiago Carvalho D' Ávila : > Oh, thanks a lot. That worked, but now I have one more doubt... > > What are the security issues related to the use of safe variable? When can I > consider it safe? Is it possible to make some kind of injection using it > this way? Is autoescape a better optio

Re: render_to_response a HTML msg

2011-03-10 Thread Thiago Carvalho D' Ávila
Oh, thanks a lot. That worked, but now I have one more doubt... What are the security issues related to the use of safe variable? When can I consider it safe? Is it possible to make some kind of injection using it this way? Is autoescape a better option? 2011/3/10 Bill Freeman > Use: > > {% if

Re: render_to_response a HTML msg

2011-03-10 Thread Bill Freeman
Use: {% if html_message %}{{ html_message|safe }}{% endif %} Presuming that you believe that the variable's content is, indeed, safe. Bill 2011/3/10 Thiago Carvalho D' Ávila : > I'm having some problem while trying to render some HTML code as a template > variable. > > What I am doing is: > >

Re: render_to_response a HTML msg

2011-03-10 Thread Gennadiy Zlobin
try {% if html_message %}{{ html_message|safe }}{% endif %} but I would do: {% if html_message %} We recommend that you click here {% endif %} - Gennadiy 2011/3/10 Thiago Carvalho D' Ávila > I'm having some problem while trying to render some HTML code as a template > vari

Re: render_to_response a HTML msg

2011-03-10 Thread Tom Evans
2011/3/10 Thiago Carvalho D' Ávila : > I'm having some problem while trying to render some HTML code as a template > variable. > > What I am doing is: > > view.py > def view(request, id): >    thing = get_object_or_404(Object, pk=id) >    if blablabla: >       return render_to_response('template.ht