Django cannot find my templatetags, even if it is in INSTALLED_APPS and has __init__.py

I just installed django-compress in /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 an error:

'Compressed' is not a valid library tag: failed to load template library from django.templatetags.compressed, No module with compressed

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

What else can I try?

+4
source share
1 answer

OK, I found a solution. You probably got the source code from google code, which no longer supports the repository (as indicated in the docs). The latest version is available at: http://github.com/pelme/django-compress

After switching to this, everything works fine.

+1
source

Source: https://habr.com/ru/post/1308951/


All Articles