django-compressor
Compresses linked and inline JavaScript or CSS into single cached files.
Decision gist · record as of 2026-08-14
Yes. Django Compressor is production-stable, actively maintained, has no known vulnerabilities, and solves a common Django performance need with low install friction. Choose it if you need automatic CSS/JS compression in templates with optional compiler support and offline processing. The MIT license carries no restrictions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2 or later and Python 3.10 or later; rcssmin and rjsmin are runtime dependencies for default minification.
- Low friction install with four runtime dependencies (django, django-appconf, rcssmin, rjsmin).
- Active maintenance with recent commits and production-stable status across Django 4.2 through 6.0.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
last release 2025-11-10 (277 days) · last repo commit 2026-07-28 · 2,870 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,275,628 downloads/mo, #3,174 on PyPI
Alternatives
Verify before relying
pip install django-compressor
# In Django settings.py:
INSTALLED_APPS = ['compressor', ...]
# In template:
{% load compress %}
{% compress css %}
<link rel="stylesheet" href="{% static 'style.css' %}">
{% endcompress %}- Performance impact of compression on build times for large static file sets
- Compatibility with specific Django middleware or caching backends beyond the documented defaults
- Whether custom compilers (LESS, SASS, CoffeeScript) require additional system dependencies
What it is and what it does
Django Compressor is a Django app that processes CSS and JavaScript in your templates, combining multiple files into single cached assets and minifying them for production. It wraps your stylesheets and scripts in template tags, parses them for linked and inline resources, applies optional compilers (like LESS or SASS), and outputs optimized `<link>` or `<script>` tags pointing to versioned files. Because the filename is content-dependent, these files can be cached indefinitely without stale-cache concerns.
The package is highly configurable: you can choose between lxml, BeautifulSoup, html5lib, or a custom HTML parser; swap in different minifiers (YUI Compressor, Closure Compiler, JSMin, csscompressor); or write custom filters for post-processing. For offline workflows, a management command lets you pre-compress assets outside the request cycle. It depends on django, django-appconf, rcssmin, and rjsmin, and supports modern Django versions (4.2 through 6.0) and Python 3.10+.
Use it for
- Reduce HTTP requests and bandwidth by combining multiple CSS files into one cached asset in production
- Automatically minify inline JavaScript and CSS in Django templates without manual build steps
- Compile LESS or SASS stylesheets and minify them in a single pipeline step during template rendering
- Serve versioned static files with far-future cache headers, ensuring browsers never serve stale assets
- Implement custom asset processing (e.g., image-to-data-URI conversion) via extensible filter classes
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Django Compressor is production-stable, actively maintained, has no known vulnerabilities, and solves a common Django performance need with low install friction. Choose it if you need automatic CSS/JS compression in templates with optional compiler support and offline processing. The MIT license carries no restrictions.
Install
django-compressor on PyPI
Before you install
Low friction install with four runtime dependencies (django, django-appconf, rcssmin, rjsmin). Active maintenance with recent commits and production-stable status across Django 4.2 through 6.0.
Requires Django 4.2 or later and Python 3.10 or later; rcssmin and rjsmin are runtime dependencies for default minification.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
pip install django-compressor
# In Django settings.py:
INSTALLED_APPS = ['compressor', ...]
# In template:
{% load compress %}
{% compress css %}
<link rel="stylesheet" href="{% static 'style.css' %}">
{% endcompress %}
Verify before relying
- Performance impact of compression on build times for large static file sets
- Compatibility with specific Django middleware or caching backends beyond the documented defaults
- Whether custom compilers (LESS, SASS, CoffeeScript) require additional system dependencies
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesdjangodjango-appconfrcssminrjsmin |
| Maintenance | Actively maintained 277 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,275,628 / month, #3,174 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP |
Evidence: django_compressor-4.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django css js minification”
- django-compressorDjango Compressor combines, minifies, and caches linked and inline…
- minify-htmlMinifies HTML, JavaScript, and CSS in a single pass using a…
- django-pipelinedjango-pipeline bundles and compresses CSS and JavaScript assets in…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also django-pipeline · webassets · django-libsass · csscompressor · Flask-Assets · django-sass-processor · lesscpy · mkdocs-minify-plugin · django-components · django-premailer