我正在寻找一个很好的独立 Python 模板引擎,它是安全的,可以防止代码注入(inject),用于允许不受信任的用户编写和编辑模板的应用程序。有人可以推荐这样的引擎吗?
请您参考如下方法:
starcom 引用了 jinja。
jinja website在“功能”下说:
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.
