Django-pipeline 'compressed' is not a valid tag library: ImportError raised loading pipeline.templatetags.compressed: No module named conf

Issue

I’m getting this error and I have no clue why suddenly I’m having issue with django-pipeline.

I’m running the project under a virtualenv and I’ve tried to create a new one with the basic app required to see if it would fix it but I always get this error:

TemplateSyntaxError at /
'compressed' is not a valid tag library: ImportError raised loading pipeline.templatetags.compressed: No module named conf
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 1.7.3
Exception Type: TemplateSyntaxError
Exception Value:    
'compressed' is not a valid tag library: ImportError raised loading pipeline.templatetags.compressed: No module named conf
Exception Location: /home/ymorin007/.virtualenvs/humor15b/local/lib/python2.7/site-packages/django/template/defaulttags.py in load, line 1119
Python Executable:  /home/ymorin007/.virtualenvs/humor15b/bin/python
Python Version: 2.7.6
Python Path:    
['/home/ymorin007/workspace/sites/humor15.com/src',
 '/home/ymorin007/.virtualenvs/humor15b/lib/python2.7',
 '/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-tk',
 '/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-old',
 '/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/ymorin007/.virtualenvs/humor15b/local/lib/python2.7/site-packages']

my setting file

########## COMPRESSION CONFIGURATION
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'

PIPELINE_COMPILERS = (
    'pipeline.compilers.less.LessCompiler',
)

PIPELINE_CSS = {
    'humor15': {
        'source_filenames': (
            'css/bootstrap.min.css',
            'css/base.css',
            'users/css/base.css',
            'signin/css/base.css',
            'css/media.css',
        ),
        'output_filename': 'css/humor15.css',
        'extra_context': {
            'media': 'screen,projection',
        },
    },
}

PIPELINE_JS = {
    'humor15': {
        'source_filenames': (
            'js/bootstap.min.js',
        ),
        'output_filename': 'js/humor15.js',
    }
}

########## END COMPRESSION CONFIGURATION

THIRD_PARTY_APPS = (
    'ckeditor',  # https://github.com/shaunsephton/django-ckeditor#installation
    'crispy_forms',
    'django_countries',  # https://pypi.python.org/pypi/django-countries http://en.wikipedia.org/wiki/ISO_3166-1
    'django_mobile',
    'pipeline',
    'social.apps.django_app.default',  # http://psa.matiasaguirre.net/
)

INSTALLED_APPS = DJANGO_APPS + HUMOR15_APPS + THIRD_PARTY_APPS + LOCAL_APPS

Solution

Since version 1.4 django-pipeline has changed the template tag name, you will have to replace:

{% load compressed %}
{% compressed_css 'foo' %}
{% compressed_js 'bar' %}

With :

{% load pipeline %}
{% stylesheet 'foo' %}
{% javascript 'bar' %}

See http://django-pipeline.readthedocs.org/en/latest/usage.html#templatetags for details.

Answered By – matagus

Answer Checked By – Marie Seifert (AngularFixing Admin)

Leave a Reply

Your email address will not be published.