开发者

Django cannot find my templatetags, even though it's in INSTALLED_APPS and has a __init__.py

开发者 https://www.devze.com 2022-12-29 02:32 出处:网络
I just installed django-compress into /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/compress.

I just installed django-compress into /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/compress.

I added 'compress' to INSTALLED_APPS.

In my template file, I wrote {% load compressed %}. I got the error:

'compressed' is not a valid tag library: Could not load template library from django.templatetags.compress开发者_如何学编程ed, No module named compressed

I verified that there is an __init__.py in compress, as well as in compress/templatetags/. I tried putting the compress directory into PYTHONPATH. I ran python and wrote import compress and that worked.

What else can I try?


OK, I found the solution. Probably you got the source code from google code which is no longer maintained repository (as stated in docs). The newest version is available at: http://github.com/pelme/django-compress

After switch to this one everything works fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消