Registry / web-framework / django-pipeline

django-pipeline

JSON →
library4.1.0pypypiunverified

Django-pipeline is an active asset packaging library for Django (current version 4.1.0) that streamlines frontend development by providing CSS and JavaScript concatenation, compression, built-in JavaScript template support, and optional data-URI embedding. It integrates with Django's staticfiles system, typically releasing new versions as needed to maintain compatibility with major Django updates.

pip install django-pipeline
INSTALL
IMPORT
SIG · DJANGO-PIPELINE
D
django-pipeline
web-frameworkpythonv4.1.0
Install
1.9s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.9s · import 0.000s · 19MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pipeline
INSTALLED_APPS = ['pipeline']
apps.add('pipeline')
Ensure 'pipeline' is listed in your project's INSTALLED_APPS setting in settings.py.
PipelineManifestStorage
STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
Required to enable Pipeline's static file handling and manifest generation.
PipelineFinder
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'pipeline.finders.PipelineFinder',)
Adds Pipeline's finder to locate static assets.
pipeline template tags
{% load pipeline %}
{% load compressed %}
The template library changed from 'compressed' to 'pipeline' in newer versions.

This quickstart demonstrates basic configuration in `settings.py` for CSS and JavaScript asset groups. It includes setting `INSTALLED_APPS`, `STATICFILES_STORAGE`, `STATICFILES_FINDERS`, and the `PIPELINE` dictionary. In your templates, load the `pipeline` tags and use `{% stylesheet 'group_name' %}` and `{% javascript 'group_name' %}`. Remember to run `python manage.py collectstatic` after configuration for production.

import os from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent # settings.py snippets INSTALLED_APPS = [ # ... other apps 'django.contrib.staticfiles', 'pipeline', ] STATIC_URL = '/static/' STATIC_ROOT = BASE_DIR / 'staticfiles' STATICFILES_DIRS = [ BASE_DIR / 'static', ] STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'pipeline.finders.PipelineFinder', ) PIPELINE = { 'STYLESHEETS': { 'main_css': { 'source_filenames': ( 'css/normalize.css', 'css/base.css', ), 'output_filename': 'css/packed_css.css', 'extra_context': { 'media': 'screen,projection', }, }, }, 'JAVASCRIPT': { 'main_js': { 'source_filenames': ( 'js/jquery.js', 'js/app.js', ), 'output_filename': 'js/packed_js.js', } } } # Example of manually specifying a compressor binary if needed # PIPELINE.update({ # 'YUGLIFY_BINARY': os.path.join(BASE_DIR, 'node_modules/.bin/yuglify'), # }) # ----------------------------------------------------- # templates/base.html (or similar) # Add at the top of the template: # {% load pipeline %} # In <head> for CSS: # {% stylesheet 'main_css' %} # Before </body> for JS: # {% javascript 'main_js' %} # After configuring settings.py and templates, run: # python manage.py collectstatic
Debug
Known issues
gotchaPipeline's asset compression and bundling features are only active when Django's `DEBUG` setting is `False`. When `DEBUG` is `True`, Pipeline serves individual source files for easier debugging, which can be confusing if you expect bundled output in development.
fix
To see compressed output, ensure `DEBUG = False` in your `settings.py` and run `python manage.py collectstatic`. For debugging, keep `DEBUG = True` to load individual files.
affects: All versions
breaking`django-pipeline` often requires external binary compilers/compressors (e.g., Yuglify, UglifyJS, Less, Sass). These tools must be installed manually (e.g., via Node.js/NPM) and their paths correctly configured in your `PIPELINE` settings. Failure to do so will result in 'command not found' errors during `collectstatic` or when serving assets.
fix
Install required compilers/compressors via your system's package manager or Node.js's npm (e.g., `npm install -g yuglify`). Then, configure the absolute path to the binary in your `PIPELINE` settings, for example: `PIPELINE.update({'YUGLIFY_BINARY': '/usr/local/bin/yuglify'})`.
affects: All versions
deprecatedFor Django versions 4.2 and higher, the `STATICFILES_STORAGE` setting is superseded by the `STORAGES` setting. While `STATICFILES_STORAGE` might still work for static files in some configurations, it is recommended to update to the `STORAGES` dictionary format for full compatibility and future-proofing.
fix
Update your `settings.py` to use `STORAGES` instead of `STATICFILES_STORAGE`. Example: `STORAGES = {'staticfiles': {'BACKEND': 'pipeline.storage.PipelineManifestStorage'}}`. Remove the old `STATICFILES_STORAGE` setting.
affects: Django 4.2+
Upgrade
Version history
4.1.0latest on PyPI · released Sep 13, 2025
Audit
Dependencies
DjangorequiredCore framework integration.
Node.js (for compilers)optionalExternal JavaScript/CSS compilers (e.g., Yuglify, UglifyJS, Less, Sass) often require Node.js and NPM for installation.
Agent activity
4 hits · last 30 days
node
4
Resources
django-pipeline — pip install django-pipeline · libregistry