{"id":13572403,"url":"https://github.com/dziegler/django-css","last_synced_at":"2026-01-14T09:39:40.033Z","repository":{"id":607383,"uuid":"244406","full_name":"dziegler/django-css","owner":"dziegler","description":"django-css is a fork of django_compressor that makes it easy to use CSS compilers with your Django projects. CSS compilers extend CSS syntax to include more powerful features such as variables and nested blocks, and pretty much rock all around.","archived":false,"fork":false,"pushed_at":"2020-10-01T09:03:54.000Z","size":265,"stargazers_count":217,"open_issues_count":13,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-21T02:55:27.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://blog.davidziegler.net","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/dziegler.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-06T16:11:58.000Z","updated_at":"2024-06-09T21:33:29.000Z","dependencies_parsed_at":"2022-07-16T15:30:48.658Z","dependency_job_id":null,"html_url":"https://github.com/dziegler/django-css","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dziegler/django-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dziegler%2Fdjango-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dziegler%2Fdjango-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dziegler%2Fdjango-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dziegler%2Fdjango-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dziegler","download_url":"https://codeload.github.com/dziegler/django-css/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dziegler%2Fdjango-css/sbom","scorecard":{"id":362747,"data":{"date":"2025-08-11","repo":{"name":"github.com/dziegler/django-css","commit":"57292253cc565bcd584795449488376d4b50f369"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/25 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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T11:11:13.504Z","repository_id":607383,"created_at":"2025-08-18T11:11:13.504Z","updated_at":"2025-08-18T11:11:13.504Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"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":[],"created_at":"2024-08-01T14:01:22.218Z","updated_at":"2026-01-14T09:39:40.017Z","avatar_url":"https://github.com/dziegler.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\nDjango css\n=================\n\n...is dead.\n=================\nSince django_compressor_ now does everything django-css does and is more actively maintained, I'm recommending that people migrate to it. More info here_.\n\n.. _here: http://blog.davidziegler.net/post/7617900947/django-css-is-dead-long-live-django-compressor\n\n------------\n\nDjango-css is a fork of django_compressor_ that makes it easy to use CSS compilers with your Django projects. CSS compilers extend CSS syntax to include more powerful features such as variables and nested blocks, and pretty much rock_ all around. Django-css can currently be used with any CSS compiler that can be called from the command line, such as HSS_, Sass_, CleverCSS_, or LESS_.\n\n.. _rock: http://blog.davidziegler.net/post/92203003/css-compilers-rock\n.. _HSS: http://ncannasse.fr/projects/hss \n.. _Sass: http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html\n.. _CleverCSS: http://github.com/dziegler/clevercss/tree/master \n.. _LESS: http://lesscss.org/\n\nThanks to django_compressor, django-css will also version and compress linked and inline javascript or CSS into a single cached file. These cached files will get served through whatever frontend server you use for serving static files, because serving static files through Django is just silly.\n\nNote: The pypi version of CleverCSS is buggy and will not work with django-css. Use the updated version on github: http://github.com/dziegler/clevercss/tree/master \n\nInstallation\n************\n\nAdd ``compressor`` to INSTALLED_APPS. You should also enable some type of caching backend such as memcached, e.g. ``CACHE_BACKEND = 'memcached://127.0.0.1:11211/'``. Don't worry, your static files are not being served through Django. The only thing stored in cache is the path to the static file.\n\n\nNEW in v2.2!\n*************\nDjango-css now uses Django's storage backend when saving compressed files. This means that if you're using something like the S3 backend in django-storages_, your compressed files will automatically be saved to S3. If not, everything should function as normal. Check out django-storages_ for more info on custom storage backends.\n\n.. _django-storages: http://code.welldev.org/django-storages/wiki/Home\n\n\nUsage\n*****\n\nSyntax::\n\n    {% load compress %}\n    {% compress \u003cjs/css\u003e %}\n    \u003chtml of inline or linked JS/CSS\u003e\n    {% endcompress %}\n\nExamples::\n\n    {% load compress %}\n    {% compress css %}\n    \u003clink rel=\"stylesheet\" href=\"/media/css/one.css\" type=\"text/css\" charset=\"utf-8\"\u003e\n    \u003clink rel=\"stylesheet\" href=\"/media/css/two.sass\" type=\"text/css\" charset=\"utf-8\"\u003e\n    {% endcompress %}\n\nWhich would be rendered like::\n\n    \u003clink rel=\"stylesheet\" href=\"/media/CACHE/css/f7c661b7a124.css\" type=\"text/css\" media=\"all\" charset=\"utf-8\"\u003e\n\nor::\n\n    {% load compress %}\n    {% compress js %}\n    \u003cscript src=\"/media/js/one.js\" type=\"text/javascript\" charset=\"utf-8\"\u003e\u003c/script\u003e\n    \u003cscript type=\"text/javascript\" charset=\"utf-8\"\u003eobj.value = \"value\";\u003c/script\u003e\n    {% endcompress %}\n\nWhich would be rendered like::\n\n    \u003cscript type=\"text/javascript\" src=\"/media/CACHE/js/3f33b9146e12.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\nIf you're using xhtml, you should use::\n\n    {% load compress %}\n    {% compress css xhtml %}\n    \u003clink rel=\"stylesheet\" href=\"/media/css/one.css\" type=\"text/css\" charset=\"utf-8\" /\u003e\n    \u003clink rel=\"stylesheet\" href=\"/media/css/two.sass\" type=\"text/css\" charset=\"utf-8\" /\u003e\n    {% compress css %}\n\nWhich would be rendered like::\n\n    \u003clink rel=\"stylesheet\" href=\"/media/CACHE/css/f7c661b7a124.css\" type=\"text/css\" media=\"all\" charset=\"utf-8\" /\u003e\n\n\nSettings\n********\n\n`COMPILER_FORMATS` default: {}\n  A dictionary specifying the compiler and arguments to associate with each extension. \n\n\ndjango-css will select which CSS compiler to use based off a file's extension. For example::\n\n    COMPILER_FORMATS = {\n        '.sass': {\n            'binary_path':'sass',\n            'arguments': '*.sass *.css' \n        },\n        '.hss': {\n            'binary_path':'/home/dziegler/hss',\n            'arguments':'*.hss'\n        },\n        '.ccss': {\n            'binary_path':'clevercss',\n            'arguments': '*.ccss'\n        },\n    }\n\n\nwill use Sass to compile `*.sass` files, HSS to compile `*.hss` files, and clevercss to compile `*.ccss` files. `*.css` files will be treated like normal css files. \n\nbinary_path is the path to the CSS compiler. In the above example, sass and clevercss are installed in my path, and   hss is located at /home/dziegler/hss.\n\narguments are arguments you would call in the command line to the compiler. The order and format of these will depend on the CSS compiler you use. Prior to compilation, * will be replaced with the name of your file to be compiled.\n\nIf this seems a little hacky, it's because I wanted to make it easy to use whatever CSS compiler you want with as little setup as possible. \n\n\n`COMPRESS` default: the opposite of `DEBUG`\n  Boolean that decides if compression will happen.\n\n`COMPRESS_CSS_FILTERS` default: []\n  A list of filters that will be applied to CSS.\n\n`COMPRESS_JS_FILTERS` default: ['compressor.filters.jsmin.JSMinFilter'])\n  A list of filters that will be applied to javascript.\n\n`COMPRESS_URL` default: `MEDIA_URL`\n  Controls the URL that linked media will be read from and compressed media\n  will be written to.\n\n`COMPRESS_ROOT` default: `MEDIA_ROOT`\n  Controls the absolute file path that linked media will be read from and\n  compressed media will be written to.\n\n`COMPRESS_OUTPUT_DIR` default: `\"CACHE\"`\n  Controls the directory inside `COMPRESS_ROOT` that compressed files will\n  be written to.\n \n`ABSOLUTE_CSS_URLS` default: `True`\n  If True, all relative url() bits specified in linked CSS files are automatically\n  converted to absolute URLs while being processed. Any local absolute urls (those\n  starting with a '/') are left alone.\n\n\nNotes\n*****\n\nStylesheets that are @import'd are not compressed into the main file. They are\nleft alone.\n\nIf the media attribute is set on \u003cstyle\u003e and \u003clink\u003e elements, a separate compressed file is created and linked for each media value you specified. This allows the media attribute to remain on the generated link element, instead of wrapping your CSS with @media blocks (which can break your own @media queries or @font-face declarations). It also allows browsers to avoid downloading CSS for irrelevant media types.\n\nLinked files must be on your COMPRESS_URL (which defaults to MEDIA_URL).\nIf DEBUG is true off-site files will throw exceptions. If DEBUG is false\nthey will be silently stripped.\n\nCSS files are compiled only when needed, because it would be silly to re-compile on every page request. The way this works is that django-css looks at the time your css was last modified, and the time your CleverCSS, HSS, etc file was modified. If the modification time for the CleverCSS, HSS, etc file is after the css file's, then the css file gets re-compiled. \n\nIf COMPRESS is False (defaults to the opposite of DEBUG) CSS files will still be compiled if needed, but files will not be compressed and versioned.\n\nThe pypi version of CleverCSS is buggy and will not work with django-css. Use the updated version on github: http://github.com/dziegler/clevercss/tree/master \n\n**Recommendations:**\n\n* Use only relative or full domain absolute urls in your CSS files.\n* Avoid @import! Simply list all your CSS files in the HTML, they'll be combined anyway.\n\n\nChanges from 1.0.0, aka the version from google code\n****************************************************\n\nDjango-css was previously using django-compress_ for versioning and compression, and it now uses django_compressor_. The main reasons being that with django_compressor, css/js files are included in the template itself, not in settings, and versioning is much cleaner. Version 2 requires much less setup and is easier to use, but is not compatible with version 1.\n\n.. _django-compress: http://code.google.com/p/django-compress/\n.. _django_compressor: https://github.com/jezdez/django_compressor/\n\nSpecial thanks to Christian Metts and Andreas Pelme for all their hard work on django_compressor and django-compress.\n\n\n\n\nDependecies\n***********\n\n* BeautifulSoup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdziegler%2Fdjango-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdziegler%2Fdjango-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdziegler%2Fdjango-css/lists"}