{"id":42180529,"url":"https://github.com/jjjkkkjjj/rest_framework_channels","last_synced_at":"2026-01-26T22:04:09.240Z","repository":{"id":252594617,"uuid":"840643378","full_name":"jjjkkkjjj/rest_framework_channels","owner":"jjjkkkjjj","description":"The enhanced modules for REST WebSockets using django channels.","archived":false,"fork":false,"pushed_at":"2025-06-28T07:54:03.000Z","size":3083,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T11:02:38.191Z","etag":null,"topics":["channels","django","django-rest-framework","rest-api","restful-api","websocket"],"latest_commit_sha":null,"homepage":"https://jjjkkkjjj.github.io/rest_framework_channels/","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/jjjkkkjjj.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-10T08:41:05.000Z","updated_at":"2025-06-28T07:54:07.000Z","dependencies_parsed_at":"2024-08-15T16:32:15.711Z","dependency_job_id":"79f293be-8629-4d62-aeb9-28e4ba59667f","html_url":"https://github.com/jjjkkkjjj/rest_framework_channels","commit_stats":null,"previous_names":["jjjkkkjjj/channels_rest_framework","jjjkkkjjj/rest_framework_channels"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jjjkkkjjj/rest_framework_channels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjjkkkjjj%2Frest_framework_channels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjjkkkjjj%2Frest_framework_channels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjjkkkjjj%2Frest_framework_channels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjjkkkjjj%2Frest_framework_channels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjjkkkjjj","download_url":"https://codeload.github.com/jjjkkkjjj/rest_framework_channels/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjjkkkjjj%2Frest_framework_channels/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28789721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: 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":["channels","django","django-rest-framework","rest-api","restful-api","websocket"],"created_at":"2026-01-26T22:02:52.232Z","updated_at":"2026-01-26T22:04:09.186Z","avatar_url":"https://github.com/jjjkkkjjj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rest_framework_channels\n\nThe enhanced modules for REST WebSockets using django channels.\n\n## Installation\n\n```bash\npip install rest_framework_channels\n```\n\nAfter installing it, you should insert 'rest_framework_channels' in the INSTALLED_APPS.\n\n```python\nINSTALLED_APPS = [\n    # Websocket\n    'daphne',\n    'channels',\n    'rest_framework_channels', # add\n    ...\n```\n\n## Introduction\n\nrest_framework_channels is the enhanced modules for REST WebSockets using django [channels](https://channels.readthedocs.io/en/latest/).\n\nYou can use `serializers` and `queryset` in [rest_framework](https://www.django-rest-framework.org/) in rest_framework_channels. Also, we are ready for similar `permissions` and `generics` too.\n\n### Example\n\nWe use the below model and serializer as example.\n\n```python\nclass TestModel(models.Model):\n    \"\"\"Simple model to test with.\"\"\"\n\n    title = models.CharField(max_length=255)\n    content = models.CharField(max_length=1024)\n\nclass TestSerializer(ModelSerializer):\n    class Meta:\n        model = TestModel\n        fields = '__all__'\n```\n\n```python\nfrom rest_framework_channels import generics\nfrom rest_framework_channels.consumers import AsyncAPIConsumer\nfrom rest_framework_channels.permissions import IsAuthenticated\n\nclass ChildActionHandler(generics.RetrieveAPIActionHandler):\n    serializer_class = TestSerializer\n    queryset = TestModel.objects.all()\n    permission_classes = (IsAuthenticated,)\n\nclass ParentConsumer(AsyncAPIConsumer):\n    # You can define the routing inside the consumer similar with original django's urlpatterns\n    routepatterns = [\n        re_path(\n            r'test_child_route/(?P\u003cpk\u003e[-\\w]+)/$',\n            ChildActionHandler.as_aaah(),\n        ),\n    ]\n```\n\nWhen you send the below json after establishing the connection,\n\n```python\n{\n    'action': 'retrieve', # Similar with GET method of HTTP request\n    'route': 'test_child_route/1/',\n}\n```\n\nyou will get the below response. This mechanism is very similar with original rest_framework!\n\n```python\n{\n    'errors': [],\n    'data': {\n        'id': 1,\n        'title': 'title',\n        'content': 'content'\n    },\n    'action': 'retrieve',\n    'route': 'test_child_route/1/',\n    'status': 200,\n}\n```\n\nAs you can see `permission_classes`, you will be rejected when you send that json without login.\n\n```python\n{\n    'errors': ['Some Error Messages']\n    'data': None,\n    'action': 'retrieve',\n    'route': 'test_child_route/1/',\n    'status': 403,\n}\n```\n\n## Details\n\nFor more details, see [docs](https://jjjkkkjjj.github.io/rest_framework_channels/).\n\n## Development\n\n### code\n\n```bash\npip install -e .\npip install twine\n```\n\n### documentation\n\n```bash\ncd sphinx\nsudo apt-get -y install plantuml\npip install -r requirements.txt\n```\n\n- generate rst files and html files\n\n```bash\ncd sphinx\nbash build.sh\n```\n\n## Reference\n\nThis project is VERY inspired by [djangochannelsrestframework](https://github.com/NilCoalescing/djangochannelsrestframework).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjjkkkjjj%2Frest_framework_channels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjjkkkjjj%2Frest_framework_channels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjjkkkjjj%2Frest_framework_channels/lists"}