Friday, 15 January 2010

python - Plain text with embedded html tags are not rendering properly -



python - Plain text with embedded html tags are not rendering properly -

i have 'blog' page on website submit blog entries embedded html tags , entires render tags properly. illustration entry:

<p>blog blog blog!</p>

but, when display these entries on webpage tags turn plaintext equivalents:

&lt;p&gt; blog blog blog &lt;/p&gt;

thus, html tags no more , page rendering <p>blog blog blog </p>

is there can have tags render properly? (javascript?) i'm using django models store blog entries , template scheme show entries on page. code:

models.py

class blogentry(models.model): title = models.charfield(max_length=64) subtitle = models.charfield(max_length=64) content = models.textfield() image = models.charfield(max_length=128, blank=true) tags = models.manytomanyfield(tag) date = models.datetimefield(auto_now_add=true) def __unicode__(self): homecoming self.title

blog.html

{% b in blogs %} {% if b.picture %} <img class="pic" src="{% static 'img/{{ b.picture }}' %}"> {% endif %} <h2>{{ b.title }}</h2> <h4>{{ b.subtitle }}</h4> <p>{{ b.date }}</p> <div id="content"> {{ b.content }} </div> {% t in b.tags.objects.all %} {{ t.subject }} {% endfor %} <hr> {% endfor %}

i appreciate help!

python html django

No comments:

Post a Comment