{"id":23168047,"url":"https://github.com/abdenasser/dr_scaffold","last_synced_at":"2025-09-14T23:39:46.014Z","repository":{"id":39762115,"uuid":"398059974","full_name":"Abdenasser/dr_scaffold","owner":"Abdenasser","description":"scaffold django rest apis like a champion 🚀","archived":false,"fork":false,"pushed_at":"2023-10-02T23:49:26.000Z","size":16300,"stargazers_count":162,"open_issues_count":0,"forks_count":15,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-09-14T15:58:45.819Z","etag":null,"topics":["apps","command-line-tool","django","django-rest-framework","generator","hacktoberfest","json-api","python","rest-api","scaffold","scaffolding","web"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Abdenasser.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":null}},"created_at":"2021-08-19T19:57:43.000Z","updated_at":"2025-08-09T03:19:27.000Z","dependencies_parsed_at":"2024-01-14T15:23:27.622Z","dependency_job_id":"831924ba-4838-41f2-8ac7-ab68db5d9f9a","html_url":"https://github.com/Abdenasser/dr_scaffold","commit_stats":{"total_commits":217,"total_committers":9,"mean_commits":24.11111111111111,"dds":"0.13824884792626724","last_synced_commit":"2dbec413c7047a23a8b6028876a2be2ad42d5f01"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Abdenasser/dr_scaffold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdenasser%2Fdr_scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdenasser%2Fdr_scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdenasser%2Fdr_scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdenasser%2Fdr_scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abdenasser","download_url":"https://codeload.github.com/Abdenasser/dr_scaffold/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdenasser%2Fdr_scaffold/sbom","scorecard":{"id":7828,"data":{"date":"2025-08-11","repo":{"name":"github.com/Abdenasser/dr_scaffold","commit":"a9bf46e6f7790c3d88480059ec06c778471ec582"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 4/15 approved changesets -- score normalized to 2","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/Abdenasser/dr_scaffold/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/Abdenasser/dr_scaffold/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:24","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"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: MIT License: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 20 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"}},{"name":"Vulnerabilities","score":0,"reason":"41 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2023-254 / GHSA-jfhm-5ghh-2f97","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5","Warn: Project is vulnerable to: PYSEC-2023-13 / GHSA-2hrw-hx67-34x6","Warn: Project is vulnerable to: PYSEC-2023-225 / GHSA-7h4p-27mh-hmrw","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2022-245 / GHSA-8x94-hmjh-97hq","Warn: Project is vulnerable to: PYSEC-2023-226 / GHSA-h8gc-pgj2-vjm3","Warn: Project is vulnerable to: PYSEC-2023-100 / GHSA-jh3w-4vvf-mjgr","Warn: Project is vulnerable to: PYSEC-2022-213 / GHSA-p64x-8rxx-wf6q","Warn: Project is vulnerable to: PYSEC-2023-12 / GHSA-q2jf-h9jm-m7p4","Warn: Project is vulnerable to: PYSEC-2023-222 / GHSA-qmf9-6jqf-j8fq","Warn: Project is vulnerable to: PYSEC-2022-304 / GHSA-qrw5-5h28-6cmg","Warn: Project is vulnerable to: PYSEC-2023-61 / GHSA-r3xc-prgr-mg9p","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2024-47 / GHSA-vm8q-m57g-pff3","Warn: Project is vulnerable to: PYSEC-2024-28 / GHSA-xxj9-f6rv-m3x4","Warn: Project is vulnerable to: GHSA-gw84-84pc-xp82","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-2m57-hf25-phgg","Warn: Project is vulnerable to: PYSEC-2023-87 / GHSA-rrm6-wvj7-cwh2","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"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-14T13:57:09.572Z","repository_id":39762115,"created_at":"2025-08-14T13:57:09.572Z","updated_at":"2025-08-14T13:57:09.572Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275184415,"owners_count":25419910,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["apps","command-line-tool","django","django-rest-framework","generator","hacktoberfest","json-api","python","rest-api","scaffold","scaffolding","web"],"created_at":"2024-12-18T02:37:42.202Z","updated_at":"2025-09-14T23:39:45.947Z","avatar_url":"https://github.com/Abdenasser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/Abdenasser/dr_scaffold\"\u003e\u003cimg src=\"https://ph-files.imgix.net/99f3cc0a-58b1-4c16-bb41-1963b0a692fc.png\" alt=\"dr_scaffold blueprint icon\" height=\"80\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003edr_scaffold\u003c/h1\u003e\n\u003cp align=\"center\"\u003eScaffold django rest apis like a champion ⚡. said no one before\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://codecov.io/gh/Abdenasser/dr_scaffold\"\u003e\u003cimg src=\"https://codecov.io/gh/Abdenasser/dr_scaffold/branch/main/graph/badge.svg?token=VLUZWSTJV2\"/\u003e\u003c/a\u003e \u003ca href=\"https://app.travis-ci.com/Abdenasser/dr_scaffold\"\u003e\u003cimg src=\"https://app.travis-ci.com/Abdenasser/dr_scaffold.svg?branch=main\"/\u003e\u003c/a\u003e \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/pypi/l/ansicolortags.svg\"/\u003e\u003c/a\u003e \u003ca href=\"https://pypi.org/project/dr-scaffold/\"\u003e\u003cimg src=\"https://d25lcipzij17d.cloudfront.net/badge.svg?id=py\u0026r=r\u0026type=6e\u0026v=2.1.2\u0026x2=0\"/\u003e\u003c/a\u003e \u003ca href=\"https://pepy.tech/project/dr-scaffold\"\u003e\u003cimg src=\"https://pepy.tech/badge/dr-scaffold\"/\u003e\u003c/a\u003e \u003ca href=\"https://twitter.com/intent/tweet?text=Scaffold django rest apis like a champion ⚡. said no one before.\u0026url=https://github.com/Abdenasser/dr_scaffold\u0026hashtags=python,opensource,django,api,developers\"\u003e\u003cimg src=\"http://randojs.com/images/tweetShield.svg\" alt=\"Tweet\" height=\"20\"/\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n# Overview\n\nThis library will help you to scaffold full **Restful API Resources** in seconds using only one command:\n\n```console\n$ python manage.py dr_scaffold blog Post body:textfield author:foreignkey:Author\n```\n\n- `models.py` with Models and fields generated by the CLI ⚡\n- `admin.py` with Models registered and ready ⚡\n- `views.py` with appropriate ViewSets ready⚡\n- `urls.py` with appropriate URLs ready.⚡\n- `serializers.py` with Model Serializers ready ⚡\n\n- and more ...\n\n# Installation and usage\n\n\u003e For a detailed guide read [scaffold django apis like a champion](https://www.abdenasser.com/2021/08/25/scaffold-django-apis-like-a-champion/), this library assumes that you have **Django Rest Framework**. if not, please refer to [this guide](https://www.django-rest-framework.org/#installation).\n\n#### Install dr_scaffold package :\n\n```console\n$ pip install dr-scaffold\n```\n\n#### Add dr_scaffold to your INSTALLED_APPS like this:\n\n```python\nINSTALLED_APPS = [\n    ...\n    'dr_scaffold'\n]\n```\n\n#### Add CORE_FOLDER and API_FOLDER to your settings.py (optional):\n\n```python\nCORE_FOLDER = \"core_dir/\"\nAPI_FOLDER = \"api_dir/\"\n```\n\n#### Run your scaffolds like this:\n\n```console\n$ python manage.py dr_scaffold blog Post body:textfield author:foreignkey:Author\n```\n\n# Generate tests\n\nWe support generating tests for your models and apis, you can generate tests by adding `--tests` to your command like follow:\n\n```console\n$ python manage.py dr_scaffold blog Author name:charfield --tests\n```\n\nThis will generate factories for your models and their tests (ViewSets tests will be added soon), we depend on `pytest` and `factory_boy` so you should have them installed in order to run your tests.\n\nAlso bare in mind that you should run your migrations before running the tests\n\n# Generate ViewSet Mixins\n\nWe support two types of ViewSets, we support **ModelViewSet** and we\nsupport **ViewSets** with Mixins.\n\n- ModelViewSets are the default that get generated with the\n  dr_scaffold command\n- To generate a view with Mixins pass a value of what mixins you want\n  to include like `--mixins CRUD` this will result in a view with the\n  Create, List, Retrieve, Update, Destroy actions.\n\nLet's generate an API that does only support the **Create** and **Read**\nmethods (Read is both list and retrieve):\n\n```console\n$ python manage.py dr_scaffold blog Author name:charfield --mixins CR\n```\n\nThe command will generate an Author API with a ViewSet like the\nfollowing:\n\n```python\nclass AuthorViewSet(\n    mixins.CreateModelMixin,\n    mixins.ListModelMixin,\n    mixins.RetrieveModelMixin,\n    viewsets.GenericViewSet\n):\n    queryset = Author.objects.all()\n    serializer_class = AuthorSerializer\n    #permission_classes = (permissions.IsAuthenticated,)\n\n    def get_queryset(self):\n        #user = self.request.user\n        queryset = Author.objects.all()\n        #insert specific queryset logic here\n        return queryset\n\n    def get_object(self):\n        #insert specific get_object logic here\n        return super().get_object()\n\n    def create(self, request, *args, **kwargs):\n        serializer = AuthorSerializer(data=request.data)\n        serializer.is_valid(raise_exception=True)\n        serializer.save()\n        return Response(serializer.data)\n\n    def list(self, request, *args, **kwargs):\n        queryset = self.get_queryset()\n        serializer = AuthorSerializer(queryset, many=True)\n        return Response(serializer.data)\n\n    def retrieve(self, request, *args, **kwargs):\n        instance = self.get_object()\n        serializer = AuthorSerializer(instance=instance)\n        return Response(serializer.data)\n```\n\n# Supported field types\n\nWe support most of django field types.\n\n# Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]\n\n\u003ca href=\"https://github.com/Abdenasser/dr_scaffold/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Abdenasser/dr_scaffold\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdenasser%2Fdr_scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdenasser%2Fdr_scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdenasser%2Fdr_scaffold/lists"}