Django找不到自定义模板标签

时间:2012-06-22 14:51:08

标签: python django django-templates

我在我的应用程序中创建了一个templatetags文件夹,里面有__init__.py + active.py,而Django找不到它,即使该应用程序在INSTALLED_APPS中:

''active'' is not a valid tag library: Template library 'active' not found, tried
django.templatetags.'active',website.home.templatetags.'active',
django_extensions.templatetags.'active',django.contrib.flatpages.templatetags.'active',
django.contrib.staticfiles.templatetags.'active',
django.contrib.admin.templatetags.'active'

1 个答案:

答案 0 :(得分:1)

您可能尝试load you template tags这样:

{% load 'active_tags' %}

请改为尝试:

{% load active_tags %}