Why does django-pipeline's {% compressed_js … %} tag output each script separately?


I’ve configured pipeline as follows:



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

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

    'website-main': {
        'source_filenames': (
        '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".


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
, and compressed files in non-DEBUG-mode.

Answered By – falsetru

Answer Checked By – Candace Johnson (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.