León Domingo
unread,Apr 11, 2013, 7:41:23 AM4/11/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to turbogea...@googlegroups.com
Hi people,
Right now I'm using TG 2.2.0 and I've tried TG 2.2.2 but I have problems during template parsing.
I use Jinja2 (2.6) and use_dotted_templatenames = False and don't use .jinja extension for templates, but .html, .js, etc.
The problem is that everything is escaped so if I have something like this:
import simplejson as sj
class AController(BaseController):
@expose('foo/bar/my_template.html')
def my_template(self):
something = sj.dumps(dict(foo='foo', bar='bar'))
return dict(something=something)
Then inside the HTML template (foo/bar/my_template.html)
<html>
<body>
<script>
var something = {{something}};
console.log(something.foo); // 'foo'
console.log(something.bar); // 'bar'
</script>
</body>
</html>
This ain't work because {{something}} is escaped to be HTML-suited instead of its "raw" format.
Same thing happens with the default error page. Instead of
We're sorry but we weren't able to process this request.
I get
<p>We're sorry but we weren't able to process this request.</p>
Does anybody know what's going on?
I have say that this happen with an existing app, upgrading TG2 version from 2.2.0 to 2.2.2. I simply use another virtual environment.
Thanks
Regards,
León