{"id":18949971,"url":"https://github.com/salesforce/django-declarative-apis","last_synced_at":"2025-12-13T04:49:14.435Z","repository":{"id":35560144,"uuid":"196613987","full_name":"salesforce/django-declarative-apis","owner":"salesforce","description":"Simple, readable, declarative APIs for Django","archived":false,"fork":false,"pushed_at":"2025-04-03T00:36:13.000Z","size":563,"stargazers_count":27,"open_issues_count":6,"forks_count":13,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-08T09:51:59.318Z","etag":null,"topics":["django","python","rest-api"],"latest_commit_sha":null,"homepage":"https://django-declarative-apis.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salesforce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-12T16:50:10.000Z","updated_at":"2025-04-04T04:39:17.000Z","dependencies_parsed_at":"2024-02-07T09:35:53.013Z","dependency_job_id":"18bd9e99-c84f-43ba-8e03-362b594000ca","html_url":"https://github.com/salesforce/django-declarative-apis","commit_stats":{"total_commits":198,"total_committers":13,"mean_commits":15.23076923076923,"dds":0.5,"last_synced_commit":"8c3dbc25cca54a24b2b0642be58f84ab81b78e7c"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/salesforce/django-declarative-apis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fdjango-declarative-apis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fdjango-declarative-apis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fdjango-declarative-apis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fdjango-declarative-apis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salesforce","download_url":"https://codeload.github.com/salesforce/django-declarative-apis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesforce%2Fdjango-declarative-apis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260933472,"owners_count":23084957,"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":["django","python","rest-api"],"created_at":"2024-11-08T13:20:05.741Z","updated_at":"2025-12-13T04:49:14.422Z","avatar_url":"https://github.com/salesforce.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Documentation Status](https://readthedocs.org/projects/django-declarative-apis/badge/?version=stable)](https://django-declarative-apis.readthedocs.io/en/stable/?badge=stable)\n\n\nOverview\n========\n\ndjango-declarative-apis is a framework built on top of Django aimed at teams implementing RESTful APis. It provides a simple interface to define endpoints declaratively. Some benefits to using django-declarative-apis:\n\n-   Define endpoints declaratively\n-   Define model-bound and unbound resource endpoints with a consistent interface\n-   OAuth 1.0a authentication out of the box\n-   Define resource and endpoint-bound tasks, promoting modularity\n-   Define synchronous and asynchronous tasks (asynchronous tasks implemented with Celery)\n-   Separation of concerns between request body processing and business logic\n\n\nQuick start\n===========\n\nThis guide is intended to demonstrate the bare minimum in order to get a django-declarative-apis project up and running. The example directory contains further examples using endpoint to model relationships, authentication and response attribute filtering.\n\nCreate django app\n-----------------\n\n``` sourceCode\n./manage startapp myapp\n```\n\nAdd app to INSTALLED\\_APPS\n--------------------------\n\n``` python\nINSTALLED_APPS = [\n   'django_declarative_apis',\n   'myapp',\n]\n```\n\nAdd required config\n-------------------\n\n``` python\nDECLARATIVE_ENDPOINT_RESOURCE_ADAPTER = 'django_declarative_apis.adapters.EndpointResource'\nDECLARATIVE_ENDPOINT_AUTHENTICATION_HANDLERS = 'django_declarative_apis.authentication.oauthlib.oauth1.TwoLeggedOauth1'\n```\n\nmyapp/urls.py\n-------------\n\n``` python\nfrom django_declarative_apis import adapters\nimport myapp.resources\n\nclass NoAuth:\n   @staticmethod\n   def is_authenticated(request):\n      return True\n\n\nurlpatterns = [\n    url(\n        r'^ping$',\n        adapters.resource_adapter(\n            get=myapp.resources.PingDefinition,\n            authentication=NoAuth\n        )\n    ),\n]\n```\n\nmyproject/myproject/urls.py\n---------------------------\n\n``` python\nfrom django.conf.urls import url, include\nimport myapp.urls\n\nurlpatterns = [\n   url(r'^', include(myapp.urls)),\n]\n```\n\nmyapp/resources.py\n------------------\n\n``` python\nfrom django_declarative_apis import machinery\n\n\nclass PingDefinition(machinery.BaseEndpointDefinition):\n    def is_authorized(self):\n        return True\n\n    @property\n    def resource(self):\n        return {'ping': 'pong'}\n```\n\nOptional: Implement Custom Event Hooks for Event Emission\n-----\n```bash\n# settings.py \nDDA_EVENT_HOOK = \"my_app.hooks.custom_event_handler\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fdjango-declarative-apis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesforce%2Fdjango-declarative-apis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesforce%2Fdjango-declarative-apis/lists"}