【发布时间】:2013-08-03 21:22:39
【问题描述】:
我想在 django 中使用标签。
所以我创建了project/main_appname/templatetags.
然后我添加了__init__.py 和active.py。
但是,当我在模板 html 中使用 {% load active %} 时,错误信息是
active' is not a valid tag library: Template library active not found, tried django.templatetags.active,django.contrib.staticfiles.templatetags.active
我的设置有什么问题?
【问题讨论】:
-
是否安装了
main_appname? -
哦,我看到问题了,在Installed中添加main_appname后,终于可以加载标签了
标签: python django web-applications tags