Offline compression error #131

dboris opened this Issue Oct 7, 2011 · 7 comments


None yet
8 participants

dboris commented Oct 7, 2011

Trying to compress media files offline results in the following error using django_compressor 1.1 with Django 1.2.5 on Mac OS X:

Traceback (most recent call last):
  File "bin/django", line 72, in 
  File "/Users/boris/project/eggs/djangorecipe-0.22-py2.6.egg/djangorecipe/", line 16, in main
  File "/Users/boris/project/parts/django/django/core/management/", line 438, in execute_manager
  File "/Users/boris/project/parts/django/django/core/management/", line 379, in execute
  File "/Users/boris/project/parts/django/django/core/management/", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/boris/project/parts/django/django/core/management/", line 67, in load_command_class
    module = import_module('' % (app_name, name))
  File "/Users/boris/project/parts/django/django/utils/", line 35, in import_module
  File "/Users/boris/project/eggs/django_compressor-1.1-py2.6.egg/compressor/management/commands/", line 16, in 
    from django.template.loader_tags import ExtendsNode, BlockNode, BLOCK_CONTEXT_KEY
  File "/Users/boris/project/parts/django/django/template/", line 3, in 
    from django.template.loader import get_template
  File "/Users/boris/project/parts/django/django/template/", line 198, in 
  File "/Users/boris/project/parts/django/django/template/", line 1049, in add_to_builtins
  File "/Users/boris/project/parts/django/django/template/", line 999, in import_library
    raise InvalidTemplateLibrary("Template library %s does not have a variable named 'register'" % taglib_module)
django.template.InvalidTemplateLibrary: Template library django.template.loader_tags does not have a variable named 'register'

vad commented Oct 10, 2011


django-compressor 1.1
Django 1.3.1

vad commented Oct 10, 2011

django-compressor 1.0.1 works


richleland commented Oct 11, 2011

Dug around on this for a bit. I found that if I add the following line back in from django-compressor 1.0.1:

from django.template.loader import get_template

Everything works again. I'd really like to understand exactly why this happens, but just don't have time to dig in at the moment. I'll submit the temp fix as a pull request.

richleland added a commit to richleland/django_compressor that referenced this issue Oct 11, 2011

Having the same issue here on Mac OS X Lion with Django 1.3.1 and django_compressor 1.1. The patch by @richleland fixes it.

hynek commented Oct 17, 2011

Same on Oneiric, this bug isn't Mac related.


peterbe commented Oct 17, 2011

For the record, I had the same problem and applying the patch in the above mentioned pull request solves it.

nsb commented Oct 21, 2011

Same issue, on Ubuntu. Applying patch fixed it for me also.

jezdez added a commit that referenced this issue Oct 28, 2011

Merge pull request #137 from richleland/offline
Re-added import statement that allows offline compression again. Refs #131

@jezdez jezdez closed this Oct 28, 2011

henzk added a commit to henzk/django-productline that referenced this issue May 23, 2014

force registration of overextends tag library
this fixes sporadic import error by importing get_template  ?!?!?!
most likely a race condition of some sort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment