{"id":32210435,"url":"https://github.com/armandtvz/django-compress-staticfiles","last_synced_at":"2026-02-19T23:01:29.809Z","repository":{"id":57419460,"uuid":"256768116","full_name":"armandtvz/django-compress-staticfiles","owner":"armandtvz","description":"A Django static files storage backend inheriting from ManifestFilesMixin and StaticFilesStorage. Compresses, using GZip and/or Brotli, and minifies static files when running the Django collectstatic command.","archived":false,"fork":false,"pushed_at":"2021-06-30T13:13:10.000Z","size":30,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-22T06:38:15.210Z","etag":null,"topics":["compression","django","minification","python","staticfiles"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armandtvz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-18T14:03:17.000Z","updated_at":"2023-03-15T12:52:06.000Z","dependencies_parsed_at":"2022-09-13T07:23:28.375Z","dependency_job_id":null,"html_url":"https://github.com/armandtvz/django-compress-staticfiles","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/armandtvz/django-compress-staticfiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armandtvz%2Fdjango-compress-staticfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armandtvz%2Fdjango-compress-staticfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armandtvz%2Fdjango-compress-staticfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armandtvz%2Fdjango-compress-staticfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armandtvz","download_url":"https://codeload.github.com/armandtvz/django-compress-staticfiles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armandtvz%2Fdjango-compress-staticfiles/sbom","scorecard":{"id":207507,"data":{"date":"2025-08-11","repo":{"name":"github.com/armandtvz/django-compress-staticfiles","commit":"b24515f7a1ea12c99e74775324783c08d6659da2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"42 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2020-29 / GHSA-5v8v-66v8-mwm7","Warn: Project is vulnerable to: PYSEC-2014-5 / GHSA-296w-6qhq-gf92","Warn: Project is vulnerable to: PYSEC-2011-2 / GHSA-3jqw-crqj-w8qw","Warn: Project is vulnerable to: PYSEC-2012-3 / GHSA-59w8-4wm2-4xw8","Warn: Project is vulnerable to: PYSEC-2012-4 / GHSA-5h2q-4hrp-v9rr","Warn: Project is vulnerable to: PYSEC-2014-6 / GHSA-625g-gx8c-xcmg","Warn: Project is vulnerable to: PYSEC-2015-8 / GHSA-6565-fg86-6jcx","Warn: Project is vulnerable to: PYSEC-2021-98 / GHSA-68w8-qjq3-2gfm","Warn: Project is vulnerable to: PYSEC-2012-2 / GHSA-78vx-ggch-wghm","Warn: Project is vulnerable to: PYSEC-2015-9 / GHSA-7fq8-4pv5-5w5c","Warn: Project is vulnerable to: PYSEC-2015-4 / GHSA-7qfw-j7hp-v45g","Warn: Project is vulnerable to: PYSEC-2011-9 / GHSA-7wph-fc4w-wqp2","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2014-2 / GHSA-89hj-xfx5-7q66","Warn: Project is vulnerable to: GHSA-8x94-hmjh-97hq","Warn: Project is vulnerable to: PYSEC-2016-2 / GHSA-c8c8-9472-w52h","Warn: Project is vulnerable to: PYSEC-2016-3 / GHSA-crhm-qpjc-cm64","Warn: Project is vulnerable to: PYSEC-2014-4 / GHSA-f7cm-ccfp-3q4r","Warn: Project is vulnerable to: PYSEC-2016-16 / GHSA-fp6p-5xvw-m74f","Warn: Project is vulnerable to: PYSEC-2011-8 / GHSA-fwr5-q9rx-294f","Warn: Project is vulnerable to: PYSEC-2015-5 / GHSA-gv98-g628-m9x5","Warn: Project is vulnerable to: PYSEC-2015-20 / GHSA-h582-2pch-3xv3","Warn: Project is vulnerable to: PYSEC-2011-5 / GHSA-h95j-h2rv-qrg4","Warn: Project is vulnerable to: GHSA-hmr4-m2h5-33qx","Warn: Project is vulnerable to: PYSEC-2015-6 / GHSA-jhjg-w2cp-5j44","Warn: Project is vulnerable to: PYSEC-2016-15 / GHSA-pw27-w7w4-9qc7","Warn: Project is vulnerable to: PYSEC-2015-10 / GHSA-q5qw-4364-5hhm","Warn: Project is vulnerable to: PYSEC-2011-4 / GHSA-rm2j-x595-q9cj","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2014-1 / GHSA-rvq6-mrpv-m6rm","Warn: Project is vulnerable to: PYSEC-2014-7 / GHSA-rw75-m7gp-92m3","Warn: Project is vulnerable to: PYSEC-2019-16 / GHSA-vfq6-hq5r-27r6","Warn: Project is vulnerable to: PYSEC-2014-3 / GHSA-wqjj-hx84-v449","Warn: Project is vulnerable to: PYSEC-2011-3 / GHSA-wxg3-mfph-qg9w","Warn: Project is vulnerable to: PYSEC-2011-1 / GHSA-x88j-93vc-wpmp","Warn: Project is vulnerable to: PYSEC-2007-1","Warn: Project is vulnerable to: PYSEC-2008-1","Warn: Project is vulnerable to: PYSEC-2008-2","Warn: Project is vulnerable to: PYSEC-2009-3","Warn: Project is vulnerable to: PYSEC-2015-11","Warn: Project is vulnerable to: PYSEC-2015-7","Warn: Project is vulnerable to: PYSEC-2016-18"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T00:06:09.223Z","repository_id":57419460,"created_at":"2025-08-17T00:06:09.223Z","updated_at":"2025-08-17T00:06:09.223Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29619358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compression","django","minification","python","staticfiles"],"created_at":"2025-10-22T06:32:22.405Z","updated_at":"2026-02-19T23:01:29.803Z","avatar_url":"https://github.com/armandtvz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-compress-staticfiles\n===========================\nA Django static files storage backend inheriting from [ManifestFilesMixin][16]\nand [StaticFilesStorage][12]. Compresses, using GZip and/or Brotli, and minifies\nstatic files when running the Django [collectstatic][5] command.\n\n### What this package does:\n- Compresses static files using [Brotli][1] and/or GZip. See the [included\n  filetypes][100] heading to see which filetypes are compressed.\n- Minifies JS using [rJSMin][19].\n- Minifies CSS using [csscompressor][6].\n\n### What this package does *not* do:\n- Does not support concatenation/bundling of JS or CSS.\n- Does not support transpiling from any transpiling Javascript language.\n- Does not support [SASS][13], [LESS][14] or any other CSS preprocessor.\n- This package is not a linter or tester. The collectstatic command is not the\n  place to be linting or testing your code. The primary purpose of this package\n  is compressing staticfiles for use in staging or production environments —\n  minification is optional but does so by default.\n- Does not delete stale files from your `STATIC_ROOT` directory. If changes were\n  made to some of your static files; old files will remain there. Use the\n  `--clear` flag when running `collectstatic` to delete the entire `STATIC_ROOT`\n  and recreate it — check out the Django docs for more info.\n\n### Some important things to take note of:\n- If `DEBUG = True` in your Django settings.py file; only the normal file\n  is used in templates. Templates will only use the hashed and minified\n  version of the file when `DEBUG = False`. This is the behaviour of the Django\n  [staticfiles][15] app in the `url` method of the `ManifestFilesMixin`.\n- The compressed version of the file is never used in the template. Your\n  webserver can decide which version of the file to serve depending on the\n  Accept-Encoding header in the request.\n- This package updates the manifest JSON file created by ManifestFilesMixin\n  with a path pointing to the hashed *and* minified version of each processed\n  file where applicable.\n- If there is a `.min` file to be copied to STATIC_ROOT; that file will be\n  compressed but not re-minified. If that `.min` file has a corresponding\n  non-minified counterpart, that non-minified file *will* be minified and\n  that minified file is the one that will be used to map `regular.css` to\n  `regular.min.{hash}.css` in the manifest file.\n- This package does not yet deal with the @import rule and url() function in\n  CSS; therefore the value is not updated after ManifestFilesMixin handles those\n  things — the minified file will not be referenced, only the hashed version as\n  substituted by ManifestFilesMixin.\n- The original files, for example, `somefile.css` won't be compressed\n  to `somefile.css.gz` because we will likely never use it.\n- Files smaller than 200 bytes will not be compressed.\n\n### Usage with cloud storage like Google Cloud Storage or Amazon S3:\nEven though the CompressStaticFilesStorage inherits from StaticFilesStorage,\nwhich inherits from FileSystemStorage, the CompressStaticFilesMixin and\nMinifyFilesMixin can be used with your own storage.\n\n\nQuickstart\n----------\nInstall the app and it's dependencies using:\n```\npip install django-compress-staticfiles\n```\n\nSet the [STATICFILES_STORAGE][4] setting in your project settings.py as follows:\n```python\nSTATICFILES_STORAGE = 'compress_staticfiles.storage.CompressStaticFilesStorage'\n```\nYou don't need to set any other settings for everything to work but for some\nmild customisation see the settings heading for more info.\n\nRun the [collectstatic][5] command as you usually would:\n```\npython manage.py collectstatic\n```\n\n\nSettings\n--------\nThere's no need to set these settings as they have defaults — they're there\nif you want them. All are `True` by default.\n```python\n# All are True by default.\nMINIFY_STATIC = True\nBROTLI_STATIC_COMPRESSION = True\nGZIP_STATIC_COMPRESSION = True\n```\n\n\nIncluded filetypes for compression\n----------------------------------\nOnly files ending with these extensions will be compressed:\n- css\n- js\n- txt\n- xml\n- json\n- svg\n- md\n- rst\n\n\nIncluded filetypes for minification\n-----------------------------------\n- css\n- js\n\n\nJS Minification\n---------------\nThe [rJSMin Python package][19] is used for JavaScript minification. See\nrJSMin's Github repo for docs and more information. JS is not obfuscated.\nExclamation/bang comments will be retained.\n\n\nCSS Minification\n----------------\nExclamation/bang comments will be retained.\n\n\nThere might be some questions\n-----------------------------\n#### Why not just use [django-compressor][10] or [django-pipeline][11] instead?\nThough I haven't used django-compressor or django-pipeline myself; I have gone\nthrough their respective documentation. I'm sure django-compressor and\ndjango-pipeline are excellent tools and I'm sure there's a time and place to be\nusing them.\n\nHowever, this package aims to be something smaller and simpler with\nabsolutely no configuration needed; no template tags and no extra management\ncommands. It aims to be unobtrusive; to slide straight into the regular Django\n`collectstatic' management command.\n\n#### Why no bundling/concatenation of JS or CSS?\nBundling is so HTTP/1.1. Join us in HTTP/2 where things are multiplexed. :)\nJokes aside... If you really need bundling: it's probably best to look at\nsomething like Webpack, [django-compressor][10] or [django-pipeline][11].\n\n#### Why does this package use the `ManifestFilesMixin`?\nFor those who are unfamiliar with the ManifestFilesMixin please read the\nDjango docs for [ManifestFilesMixin][16] and [ManifestStaticFilesStorage][3].\n\n\nCompatiblity\n------------\n- Compatible with Python 3.5 and above.\n- Compatible with Django 1.10 and above. Do remember that, at the time of\n  writing, Django 2.2 and below is deprecated and therefore there is only\n  official support for Django 2.2 and above.\n- Check rJSMin's Github [repo][19] / docs for more info regarding ES6\n  compatibility.\n\n\nVersioning\n----------\nThis project follows [semantic versioning][20] (SemVer).\n\n\nLicense, code of conduct and requirements\n-----------------------------------------\nCheck the root of the repo for these files.\n\n\n\n[//]: # (Links)\n\n[1]: https://github.com/google/brotli\n[2]: https://developers.google.com/closure/compiler\n[3]: https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#manifeststaticfilesstorage\n[4]: https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-STATICFILES_STORAGE\n[5]: https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#collectstatic\n[6]: https://github.com/sprymix/csscompressor\n[7]: https://terser.org/\n[8]: https://github.com/douglascrockford/JSMin\n[9]: https://github.com/yui/yuicompressor\n[10]: https://github.com/django-compressor/django-compressor\n[11]: https://github.com/jazzband/django-pipeline\n[12]: https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#staticfilesstorage\n[13]: https://sass-lang.com/\n[14]: http://lesscss.org/\n[15]: https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#static-file-development-view\n[16]: https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#manifestfilesmixin\n[17]: https://github.com/google/closure-compiler\n[18]: https://developers.google.com/closure/compiler/docs/limitations\n[19]: https://github.com/ndparker/rjsmin\n[20]: https://semver.org/\n\n[100]: /#included-filetypes-for-compression\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmandtvz%2Fdjango-compress-staticfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmandtvz%2Fdjango-compress-staticfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmandtvz%2Fdjango-compress-staticfiles/lists"}