For that reason, it’s impossible to call Python code directly within Django templates. All “programming” is fundamentally limited to the scope of what template tags can do. It is possible to write custom template tags that do arbitrary things, but the out-of-the-box Django template tags intentionally do not allow for arbitrary Python code execution.
从Django book:
试试Django templates。在Django应用程序之外设置与
DJANGO_SETTINGS_MODULE
有关的内容有点棘手,可以四处搜索,但可能是可信的。在你退房了吗?这几乎就是你所说的,它是一个强大的组合,同时保持简单,不给设计师太多的权力。:)
如果您使用过Django的模板系统,它非常类似(如果不是基于的?)金贾。在
相关问题 更多 >
编程相关推荐