简体   繁体   中英

Which Python template engine is safe to be used by untrusted users?

I'm looking for a good standalone Python template engine that is safe, against code injecting, to be used in an application that allows untrusted users to write and edit templates. Could someone recommend such an engine?

starcom referenced jinja.

The jinja website says, under "features":

Sandboxed execution mode. Every aspect of the template execution is monitored and explicitly whitelisted or blacklisted, whatever is preferred. This makes it possible to execute untrusted templates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM