Victor Callegari
Victor Callegari

Reputation: 71

django-pipeline does not work

I am trying to make django-pipeline works but it just does not work. Below is my seetting. I added 'pipeline' in the apps section.

This is the error when I attempt to open my site: 'Settings' object has no attribute 'PIPELINE'

Below is my setting:

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]

STATIC_ROOT = os.path.join(BASE_DIR, 'static_cdn')

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)

PIPELINE_JS = {
    'stats': {
        'source_filenames': (
          'js/base.js',
        ),
        'output_filename': 'site-js-min.js',
    }
}


PIPELINE_CSS = {
    'colors': {
        'source_filenames': (
          'css/base.css',
        ),
        'output_filename': 'site-css-min.css',
        'variant': 'datauri',
        'extra_context': {
            'media': 'screen,projection',
        }
    }
}

Upvotes: 2

Views: 2192

Answers (1)

Avinash Raj
Avinash Raj

Reputation: 174716

As per the docs, you need to define PIPELINE variable in settings.py which looks like,

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'JAVASCRIPT': {
        'stats': {
            'source_filenames': (
              'js/jquery.js',
              'js/d3.js',
              'js/collections/*.js',
              'js/application.js',
            ),
            'output_filename': 'js/stats.js',
        }
    }
}

Upvotes: 5

Related Questions