4

I've configured pipeline as follows:

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

)

# Static files storage
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'

# Pipeline JS compressor
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.jsmin.JSMinCompressor'

PIPELINE_JS = {
    'website-main': {
        'source_filenames': (
          'shared/jquery/jquery-1.10.2.min.js',
          'shared/bootstrap/js/bootstrap.min.js',
          'shared/jquery/jquery.cookie.js',
        ),
        'output_filename': 'pipeline-compressed/website-main.js',
    }
}

When I use {% compressed_js 'website-main' %} in my template I get a script tag for each of the 3 files configured in PIPELINE_JS. Shouldn't I see a single script tag with src="pipeline-compressed/website-main.js".

2
  • settings.DEBUG should be False. BTW, did you run collectstatic command? Commented Sep 24, 2013 at 8:12
  • @falsetru - Ugh :/ thanks so much... I was working locally (so DEBUG = True, naturally). I did run collectstatic. Thanks again. Will you put that into an answer? Commented Sep 24, 2013 at 8:15

1 Answer 1

4

Set settings.DEBUG to False to use compressed files. Or set settings.PIPELINE_ENABLED to True.

According to Usage - django-pipeline, the setting checked is simply PIPELINE, but upon viewing the source of version 1.3.15, you'll find that the setting is in fact PIPELINE_ENABLED:

The templatetags will either output the source filenames or the compressed filenames, depending on the PIPELINE setting, if you do not specify the PIPELINE setting, the source files will be used in DEBUG-mode, and compressed files in non-DEBUG-mode.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.