{"id":13415969,"url":"https://github.com/django-compressor/django-compressor","last_synced_at":"2025-05-12T15:30:25.683Z","repository":{"id":1017565,"uuid":"504028","full_name":"django-compressor/django-compressor","owner":"django-compressor","description":"Compresses linked and inline javascript or CSS into a single cached file.","archived":false,"fork":false,"pushed_at":"2025-04-07T08:14:07.000Z","size":1954,"stargazers_count":2842,"open_issues_count":134,"forks_count":603,"subscribers_count":47,"default_branch":"develop","last_synced_at":"2025-04-22T11:43:34.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://django-compressor.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-compressor.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.txt","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-02-05T15:48:14.000Z","updated_at":"2025-04-20T15:25:50.000Z","dependencies_parsed_at":"2023-07-05T15:16:47.339Z","dependency_job_id":"b400bd75-506e-4247-bd1b-aa4ffa2c8e15","html_url":"https://github.com/django-compressor/django-compressor","commit_stats":{"total_commits":1269,"total_committers":225,"mean_commits":5.64,"dds":0.6028368794326241,"last_synced_commit":"88f679c23d2d4bc4a9e914c868e5daf826d499eb"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-compressor%2Fdjango-compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-compressor%2Fdjango-compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-compressor%2Fdjango-compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-compressor%2Fdjango-compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-compressor","download_url":"https://codeload.github.com/django-compressor/django-compressor/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253765715,"owners_count":21960776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:53.360Z","updated_at":"2025-05-12T15:30:25.644Z","avatar_url":"https://github.com/django-compressor.png","language":"Python","readme":"Django Compressor\n=================\n\n.. image:: https://codecov.io/github/django-compressor/django-compressor/coverage.svg?branch=develop\n    :target: https://codecov.io/github/django-compressor/django-compressor?branch=develop\n\n.. image:: https://img.shields.io/pypi/v/django_compressor.svg\n        :target: https://pypi.python.org/pypi/django_compressor\n\n.. image:: https://img.shields.io/github/actions/workflow/status/django-compressor/django-compressor/ci.yml?branch=develop\n    :alt: Build Status\n    :target: https://github.com/django-compressor/django-compressor/actions?query=workflow%3ACI\n\nDjango Compressor processes, combines and minifies linked and inline\nJavascript or CSS in a Django template into cacheable static files.\n\nIt supports compilers such as coffeescript, LESS and SASS and is\nextensible by custom processing steps.\n\nHow it works\n------------\nIn your templates, all HTML code between the tags ``{% compress js/css %}`` and\n``{% endcompress %}`` is parsed and searched for CSS or JS. These styles and\nscripts are subsequently processed with optional, configurable compilers and\nfilters.\n\nThe default filter for CSS rewrites paths to static files to be absolute.\nBoth Javascript and CSS files are by default concatenated and minified.\n\nAs the final step the template tag outputs a ``\u003cscript\u003e`` or ``\u003clink\u003e``\ntag pointing to the optimized file. Alternatively it can also\ninline the resulting content into the original template directly.\n\nSince the file name is dependent on the content, these files can be given\na far future expiration date without worrying about stale browser caches.\n\nFor increased performance, the concatenation and compressing process\ncan also be run once manually outside of the request/response cycle by using\nthe Django management command ``manage.py compress``.\n\nConfigurability \u0026 Extensibility\n-------------------------------\n\nDjango Compressor is highly configurable and extensible. The HTML parsing\nis done using lxml_ or if it's not available Python's built-in HTMLParser by\ndefault. As an alternative Django Compressor provides a BeautifulSoup_ and a\nhtml5lib_ based parser, as well as an abstract base class that makes it easy to\nwrite a custom parser.\n\nDjango Compressor also comes with built-in support for\n`YUI CSS and JS`_ compressor, `yUglify CSS and JS`_ compressor, Google's\n`Closure Compiler`_, a Python port of Douglas Crockford's JSmin_, a Python port\nof the YUI CSS Compressor csscompressor_ and a filter to convert (some) images into\n`data URIs`_.\n\nIf your setup requires a different compressor or other post-processing\ntool it will be fairly easy to implement a custom filter. Simply extend\nfrom one of the available base classes.\n\nMore documentation about the usage and settings of Django Compressor can be\nfound on `django-compressor.readthedocs.org`_.\n\nThe source code for Django Compressor can be found and contributed to on\n`github.com/django-compressor/django-compressor`_. There you can also file tickets.\n\nThe in-development version of Django Compressor can be installed with\n``pip install git+https://github.com/django-compressor/django-compressor.git``\n\n.. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/\n.. _lxml: http://lxml.de/\n.. _html5lib: https://github.com/html5lib/html5lib-python\n.. _YUI CSS and JS: http://developer.yahoo.com/yui/compressor/\n.. _yUglify CSS and JS: https://github.com/yui/yuglify\n.. _Closure Compiler: http://code.google.com/closure/compiler/\n.. _JSMin: http://www.crockford.com/javascript/jsmin.html\n.. _csscompressor: https://github.com/sprymix/csscompressor\n.. _data URIs: http://en.wikipedia.org/wiki/Data_URI_scheme\n.. _django-compressor.readthedocs.org: https://django-compressor.readthedocs.io/en/latest/\n.. _github.com/django-compressor/django-compressor: https://github.com/django-compressor/django-compressor\n","funding_links":[],"categories":["Third-Party Packages","Asset Management","资源列表","Web Asset Management","Python","Web资产管理","Web 资源管理","Performance","Django Utilities","Minifiers - JS \u0026 CSS","Best Django Admin Interface Resources","Web Asset Management [🔝](#readme)","Awesome Python"],"sub_categories":["Static Assets","Web 资源管理","资源管理","Meetups","**⚡ Performance \u0026 Caching**","Asset Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-compressor%2Fdjango-compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-compressor%2Fdjango-compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-compressor%2Fdjango-compressor/lists"}