Wednesday, September 1, 2010

seeing HTML code, not the interpreted html

Hi all,

I am playing with iframes for the first time and am gelling some
undesired results. The 'stuff' in my frame shows as HTML code instead
of the expected html 'interpretation.' I hope that made sense) I am
looking to fix this. Here is what I did: I generated a string with all
my html in it and saved it under a request.session key. On my template
I simply put {{ key }} and thus I get my result.

Can I ge django to interpret my strinng as HTML?

Heres the relevant code


results.html (template)
...
<iframe src ="/rotamer_diff/" width="30%" height="400">
<p>Your browser does not support iframes.</p>
</iframe>
...

urls.py
...
(r'^rotamer_diff/$', rotamer_dif_frame),
...

views.py
...
def rotamer_dif_frame(request):
return render_to_response('rotamer_dif_frame.html',
request.session, context_instance=RequestContext(request))
...

rotamer_dif_frame.htm

{{ rotamer_dif_html }}


--
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

--
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.

No comments:

Post a Comment