В настройках проекта у меня есть файл тегов шаблона 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 {....}
Трассировка:
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
Что может вызвать проблемы, и яне так делаешь?
Султан