{"id":41780781,"url":"https://github.com/vied12/django-url-renditions","last_synced_at":"2026-01-25T04:00:50.085Z","repository":{"id":32466594,"uuid":"133534365","full_name":"vied12/django-url-renditions","owner":"vied12","description":"Generates renditions from url fields","archived":false,"fork":false,"pushed_at":"2023-10-03T21:08:39.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-17T04:12:21.267Z","etag":null,"topics":["django","django-rq","django-s3direct","graphene","graphene-django","image-processing","rendition","rq"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vied12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-15T15:13:35.000Z","updated_at":"2019-03-14T18:36:27.000Z","dependencies_parsed_at":"2023-01-14T21:19:10.100Z","dependency_job_id":null,"html_url":"https://github.com/vied12/django-url-renditions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vied12/django-url-renditions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vied12%2Fdjango-url-renditions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vied12%2Fdjango-url-renditions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vied12%2Fdjango-url-renditions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vied12%2Fdjango-url-renditions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vied12","download_url":"https://codeload.github.com/vied12/django-url-renditions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vied12%2Fdjango-url-renditions/sbom","scorecard":{"id":920866,"data":{"date":"2025-08-11","repo":{"name":"github.com/vied12/django-url-renditions","commit":"8dc489f38c091dbb24b4e1d2202f062af852b5f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/14 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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}}]},"last_synced_at":"2025-08-25T02:26:21.225Z","repository_id":32466594,"created_at":"2025-08-25T02:26:21.225Z","updated_at":"2025-08-25T02:26:21.225Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"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":["django","django-rq","django-s3direct","graphene","graphene-django","image-processing","rendition","rq"],"created_at":"2026-01-25T04:00:45.412Z","updated_at":"2026-01-25T04:00:50.072Z","avatar_url":"https://github.com/vied12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-url-renditions\n\ndjango-url-renditions allows to define and render renditions from django url fields. This works also pretty well with [django-s3direct](https://github.com/bradleyg/django-s3direct) fields.\n\nIt comes with a Graphene `Query` that enable renditions in your GraphQL schema.\n\n## Install\n\n```\npip install django-url-renditions\n```\n\nAdd `url_renditions` to your `INSTALLED_APPS`\n\n\n## Define your model\n\n\n```python\nfrom django.db import models\nfrom url_renditions.fields import FileUrlWithRenditions\n\n# django-url-renditions comes with a simple image resizer method.\n# Look at the implementation if you need something more specific\nfrom url_renditions.resize_image import ResizeImage\n\nclass Track(models.Model):\n    original_artwork = models.URLField()\n    artwork = FileUrlWithRenditions(\n        source='original_artwork',\n        use_job_runner=True, #  if we want to queue the job with django_rq\n        renditions={\n            'small': ResizeImage('80x80'),\n            'medium': ResizeImage('300x300'),\n        }\n    )\n\n```\n\n\nThat way, when a `Track` model get created with an `original_artwork`, `artwork` will be automatically polulated with two renditions: `small` and `medium`.\n\nTo access them, use:\n```python\nr = my_track.artwork.rendition_set.get(name='small')\nprint('url:', r.href, 'width:', r.width, 'height:', r.height)\n```\n\n\n## Graphql with Graphene\n\nAdd `url_renditions.graphql_schema.Query` to your root query.\n```python\nimport graphene\nimport url_renditions.graphql_schema  # noqa\n\nclass Query(\n        ...\n        url_renditions.graphql_schema.Query,\n        graphene.ObjectType):\n    pass\n\nschema = graphene.Schema(query=Query)\n```\n\nThen when you ask for\n\n```graphql\n{\n  track(id: \"VHJhY2s6OA==\") {\n    artwork {\n      renditions {\n        medium {\n          href\n          width\n          height\n        }\n      }\n    }\n  }\n}\n```\n\nYou get\n\n\n```json\n{\n  \"data\": {\n    \"track\": {\n      \"artwork\": {\n        \"renditions\": {\n          \"medium\": {\n            \"href\": \"https://images.unsplash.com/photo-1474314170901-f351b68f544f\",\n            \"width\": 300,\n            \"height\": 300\n          }\n        }\n      }\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvied12%2Fdjango-url-renditions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvied12%2Fdjango-url-renditions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvied12%2Fdjango-url-renditions/lists"}