在项目设置中,我使用以下导入的templatetags / lira_tags.py模板标签文件

import os
from django import template
from django.conf import settings
from django.db.models.loading import get_model
from templatetag_sugar.register import tag
from templatetag_sugar.parser import Name, Variable, Constant, Optional
from lira import get_file_uri
from lira.models import Document

我得到了下面显示的错误,尽管我的项目中没有 utils.py

'lira_tags' is not a valid tag library: ImportError raised loading mediabox.lira.templatetags.lira_tags: No module named utils

站点索引视图只是一个简单的功能

@render_to("frontend/homepage.html")
def site_index(request):
    return {....}

Traceback:

File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
111.response = callback(request, *callback_args, **callback_kwargs)
    File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/annoying/decorators.py" in wrapper
79.context_instance=RequestContext(request), mimetype=mimetype) File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/shortcuts/__init__.py" in render_to_response
20.return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
    File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in render_to_string
181.t = get_template(template_name)
    File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in find_template
  134.             source, display_name = loader(name, dirs)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in __call__
  42.         return self.load_template(template_name, template_dirs)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in load_template
  48.             template = get_template_from_string(source, origin, template_name)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader.py" in get_template_from_string
  168.     return Template(source, origin, name)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/base.py" in __init__
  108.         self.nodelist = compile_string(template_string, origin)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/base.py" in compile_string
  136.     return parser.parse()
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/loader_tags.py" in do_extends
  214.     nodelist = parser.parse()
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/Users/sultan/.virtualenvs/Soros/lib/python2.6/site-packages/django/template/defaulttags.py" in load
  1054.                                           (taglib, e))

Exception Type: TemplateSyntaxError at /
Exception Value: 'lira_tags' is not a valid tag library: ImportError raised loading mediabox.lira.templatetags.lira_tags: No module named utils

什么可能导致问题,我做错了什么?

苏丹