You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tipfy
Hi,
I am using tipfy 1.0b1.
It seems that Jinja's autoescape is automatically turned on. I can
turn it off by editing lib/dist/tipfyext/jinja2/__init__.py and
modifying the default_config variable and passing autoescape: False in
the environment_args, but is this the right way?
The README.txt of the /lib/dist folder has a warning:
This directory is removed every time the buildout tool runs, so don't
place
or edit things here because any changes will be lost!
Thanks,
Stratos
Hannes Rydén
unread,
May 5, 2011, 7:46:29 AM5/5/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tipfy
I think the correct way is to edit your config.py and add the
following line:
config['tipfyext.jinja2'] = {
'environment_args': {
'autoescape': False,
},
Mauro Asprea
unread,
May 6, 2011, 3:21:55 AM5/6/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ti...@googlegroups.com
U can also use
{% autoescape off%}
Blabla content unescaped
{% end autoescape %}
Algunos hombres ven las cosas como son y se preguntan porque. Otros sueñan cosas que nunca fueron y se preguntan por qué no?.
George Bernard Shaw
stratosgear
unread,
May 6, 2011, 10:23:46 AM5/6/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ti...@googlegroups.com
Mauro,
I would prefer to have to Autoescape, by default, off. That way I can include templates inside templates without escaping.
In case I will be outputting any user content and I want to be a little more carefull, I would then use the {% autoescape True %} in the appropriate places.
I will try what Hannes suggested and I will post again.
Thanks.
Noah McIlraith
unread,
May 11, 2011, 10:49:25 PM5/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ti...@googlegroups.com
If there are only a few instances where you don't want it to be escaped, you could use the |safe filter.
{{ dont_escape_this|safe }}
It's generally best to consider everything dangerous unless explicitly stated otherwise. Unless you are using the template to generate something other than HTML and similar formats, autoescape should be on.