class Post(db.Model):

    def html_content(self):

        def escape(s):
            return str(jinja2.escape(s))
return jinja2.Markup(escape(self.content).replace('\n', '<br>'))
Allowing <br> tags with Google App Engine and Jinja2