Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript template support, and optional data-URI image and font embedding.
Installation
To install it, simply:
pip install django-pipeline
Quickstart
Pipeline compiles and compress your assets files from STATICFILES_DIRS to your STATIC_ROOT when you run Django’s collectstatic command.
These simple steps add Pipeline to your project to compile multiple .js and .css file into one and compress them.
Add Pipeline to your installed apps:
# settings.py
INSTALLED_APPS = [
...
'pipeline',
]
Use Pipeline specified classes for STATICFILES_FINDERS and STATICFILES_STORAGE:
STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
Configure Pipeline:
# The folowing config merges CSS files(main.css, normalize.css)
# and JavaScript files(app.js, script.js) and compress them using
# `yuglify` into `css/styles.css` and `js/main.js`
# NOTE: Pipeline only works when DEBUG is False
PIPELINE = {
'STYLESHEETS': {
'css_files': {
'source_filenames': (
'css/main.css',
'css/normalize.css',
),
'output_filename': 'css/styles.css',
'extra_context': {
'media': 'screen,projection',
},
},
},
'JAVASCRIPT': {
'js_files': {
'source_filenames': (
'js/app.js',
'js/script.js',
),
'output_filename': 'js/main.js',
}
}
}
Then, you have to install compilers and compressors binary manually.
For example, you can install them using NPM and address them from node_modules directory in your project path:
PIPELINE.update({
'YUGLIFY_BINARY': path.join(BASE_DIR, 'node_modules/.bin/yuglify'),
})
# For a list of all supported compilers and compressors see documentation
Load static files in your template:
{% load pipeline %}
{% stylesheet 'css_files' %}
{% javascript 'js_files' %}
Documentation
For documentation, usage, and examples, see: https://django-pipeline.readthedocs.io
Issues
You can report bugs and discuss features on the issues page.
Changelog
See HISTORY.rst.
Metadata
Release files for django-pipeline 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_pipeline-4.1.0.tar.gz | 72.2 kB | Without provenance | Details for django_pipeline-4.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_pipeline-4.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_pipeline-4.1.0-py3-none-any.whl |
Total release size: 147.7 kB
Release files / django_pipeline-4.1.0.tar.gz
| Download URL | django_pipeline-4.1.0.tar.gz |
|---|---|
| Size | 72.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa1d79df6f215b78396cdd50ed162f8741dc4993e9fba2c78483d9b6f1e722b4
|
|
BLAKE2b-256 checksum How to use checksums |
1c7b2f78ccdad9f45a3d4f709950160f9d7e5009b2b8bec8ef636025ec89b62e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Release files / django_pipeline-4.1.0-py3-none-any.whl
| Download URL | django_pipeline-4.1.0-py3-none-any.whl |
|---|---|
| Size | 75.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdb84feb8db73b9fe8298fd9d0f6e50f30d78eb28a8ed28f73ca5d154080c3d5
|
|
BLAKE2b-256 checksum How to use checksums |
9a89fd40adbf5cc16550007ad67bffd7493c9976f7e576bf431d1bc537cfa976
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Security for django-pipeline 4.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.