django-compressor: Optimize Django Assets with Compression and Minification
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
django-compressor is a powerful Django application that processes, combines, and minifies linked and inline JavaScript or CSS into cacheable static files. It significantly enhances web application performance by reducing file sizes and optimizing asset delivery. The tool supports various compilers like LESS and SASS, offering extensive configurability for efficient asset management.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
django-compressor is an essential Django application for optimizing web assets. It takes your linked and inline JavaScript and CSS, processes them through various filters and compilers, and then combines and minifies them into single, cacheable static files. This process dramatically improves page load times and overall website performance by reducing the number of HTTP requests and the size of transmitted data.
Installation
Getting started with django-compressor is straightforward. You can install it using pip:
pip install django-compressor
After installation, add 'compressor' to your INSTALLED_APPS in your Django settings file.
Examples
Using django-compressor in your Django templates is intuitive. You wrap your CSS or JavaScript assets within {% compress %} and {% endcompress %} tags. For example, to compress CSS:
{% load compress %}
{% compress css %}
<link rel="stylesheet" href="/static/css/base.css" type="text/css" charset="utf-8">
<style type="text/css">p { border: 1px solid #ccc; }</style>
{% endcompress %}
And for JavaScript:
{% load compress %}
{% compress js %}
<script src="/static/js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function () {
console.log('Hello from inline JS!');
});
</script>
{% endcompress %}
The compressor will then output a single <link> or <script> tag pointing to the optimized, cached file.
Why Use It
django-compressor offers several compelling reasons for its adoption in Django projects:
- Performance Boost: By combining and minifying assets, it reduces HTTP requests and file sizes, leading to faster page loads.
- Caching Efficiency: Optimized files are named based on their content, allowing for far-future expiration dates and efficient browser caching.
- Compiler Support: It supports popular pre-processors like LESS, SASS, and CoffeeScript, integrating them seamlessly into your workflow.
- Extensibility: The system is highly configurable, allowing you to implement custom filters, parsers, and compressors to fit specific project needs.
- Offline Compression: You can run the compression process manually using
manage.py compress, pre-generating static files outside the request/response cycle for even better performance.
Links
For more detailed information, usage guides, and advanced configurations, refer to the official resources:
Related repositories
Similar repositories that may be relevant next.

Tau: A Minimalist Python Coding Agent for Your Terminal
September 8, 2026
Tau is a Python port of Pi's minimalist coding agent, designed to live in your terminal. It allows users to make requests like "explain this repo" or "add tests," and it can read files, edit code, and run commands. Beyond its utility, Tau also serves as a teaching project, demonstrating how coding agents are built with a small, readable codebase.

Awesome Harness Engineering: Building Reliable AI Agent Systems
September 7, 2026
Awesome Harness Engineering is a comprehensive curated list dedicated to the discipline of designing robust AI agent harnesses. It offers a wealth of resources, patterns, and templates essential for building reliable AI agent systems. Developers can explore tools, best practices, and foundational concepts across various critical areas of agent development.
Best of Agent Harnesses: A Curated List for AI Agent Development
September 7, 2026
RyanAlberts' Best of Agent Harnesses is a comprehensive, curated, and ranked list of over 100 AI agent harnesses and orchestration frameworks. It provides valuable insights for building reliable agentic systems, offering both human-readable guides and machine-readable formats for agents themselves. The repository is rescored weekly to ensure up-to-date recommendations.

Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly
September 3, 2026
Wasm Agents Blueprint is an innovative project from Mozilla AI that allows you to run Python-based AI agents directly in your web browser using WebAssembly (Wasm) and Pyodide. It bridges the gap between powerful Python AI frameworks, like the OpenAI Agents SDK, and browser-based applications. This blueprint eliminates the need for complex server setups or Docker containers, offering a streamlined way to experience AI agents.
Source repository
Open the original repository on GitHub.
10 counted GitHub visits