{"id":13814161,"url":"https://github.com/seebass/django-rest-hal","last_synced_at":"2025-05-15T03:32:59.580Z","repository":{"id":20773136,"uuid":"24057938","full_name":"seebass/django-rest-hal","owner":"seebass","description":"HAL Implementation for Django REST Framework","archived":false,"fork":false,"pushed_at":"2015-06-29T16:30:13.000Z","size":253,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-02T16:02:47.579Z","etag":null,"topics":[],"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/seebass.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":"2014-09-15T13:43:16.000Z","updated_at":"2017-03-10T22:55:46.000Z","dependencies_parsed_at":"2022-07-07T15:58:35.873Z","dependency_job_id":null,"html_url":"https://github.com/seebass/django-rest-hal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seebass%2Fdjango-rest-hal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seebass%2Fdjango-rest-hal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seebass%2Fdjango-rest-hal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seebass%2Fdjango-rest-hal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seebass","download_url":"https://codeload.github.com/seebass/django-rest-hal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225326415,"owners_count":17456936,"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":[],"created_at":"2024-08-04T04:01:45.618Z","updated_at":"2024-11-19T09:30:26.457Z","avatar_url":"https://github.com/seebass.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"django-rest-hal\n===============\n\nHAL Implementation for Django REST Framework\n\nIncludes:\n\n* HAL Implemenentation without 'curies'\n* Defining fields through url-parameter 'fields'\n* Disable link generation through url-parameter 'no-links=true'\n\nFor Django REST Framework 3 the have a look at these libs:\n\n* https://github.com/seebass/drf-hal-json\n* https://github.com/seebass/drf-nested-fields\n\n## Setup ##\n\nInclude the following settings in your django settings.py\n\t\n\t'DEFAULT_MODEL_SERIALIZER_CLASS': 'django_rest_hal.serializers.HalModelSerializer',\n    'DEFAULT_PAGINATION_SERIALIZER_CLASS': 'django_rest_hal.serializers.HalPaginationSerializer',\n    'DEFAULT_PARSER_CLASSES': ('django_rest_hal.parsers.JsonHalParser',),\n    'DEFAULT_RENDERER_CLASSES': (\n        'django_rest_hal.renderers.JsonHalRenderer'\n    )\n    \n## Usage ##\n\nPerforming REST-Requests results in following HTTP-Responses:\n\n\tGET http://localhost/api/resources/1/ HTTP/1.1\n\tContent-Type  application/hal+json\t\n\n\t{\n    \t\"_links\": {\n        \t\"self\": \"http://localhost/api/resources/1/\",\n\t\t\t\"relatedResource\": \"http://localhost/api/related-resources/1/\"\n    \t},\n    \t\"id\": 1,\n    \t\"_embedded\": {\n        \t\"subResource\": {\n            \t\"_links\": {\n                \t\"self\": \"http://localhost/resources/1/sub-resources/26/\"\n                \t\"subSubResource\": \"http://localhost/resources/1/sub-resources/26/sub-sub-resources/3\"\n            \t},\n            \t\"id\": 26,\n            \t\"name\": \"Sub Resource 26\"\n        \t}\n    \t}\n\t}\n\t\nField customization can be declared using the URL-Query-Parameter 'fields':\n\n\tGET http://localhost/api/resources/1/?fields=id,subResource.fields(name,subSubResource.fields(id) HTTP/1.1\n\tContent-Type  application/hal+json\t\n\n\t{\n    \t\"_links\": {\n        \t\"self\": \"http://localhost/api/resources/1/\",\n    \t},\n    \t\"id\": 1,\n    \t\"_embedded\": {\n        \t\"subResource\": {\n            \t\"_links\": {\n                \t\"self\": \"http://localhost/resources/1/sub-resources/26/\"\n                \t\n            \t},\n            \t\"name\": \"Sub Resource 26\"\n            \t\"_embedded\": {\n            \t\t\"subSubResource\": {\n            \t\t\t\"_links\": {\n            \t\t\t\t\"self\": \"http://localhost/resources/1/sub-resources/26/sub-sub-resources/3\"\n            \t\t\t}\n            \t\t\t\"id\": 3\n            \t\t}\n            \t\t\n            \t}\n        \t}\n    \t}\n\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseebass%2Fdjango-rest-hal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseebass%2Fdjango-rest-hal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseebass%2Fdjango-rest-hal/lists"}