我正在寻找一个很好的独立 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.
关于python - 不受信任的用户可以安全使用哪个 Python 模板引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10132781/