{"id":21030661,"url":"https://github.com/shanathvemula/test_djangochannels","last_synced_at":"2025-07-29T22:12:02.073Z","repository":{"id":241872317,"uuid":"805281721","full_name":"shanathvemula/test_djangoChannels","owner":"shanathvemula","description":"This project entails the acquisition of real-time data through Django Channels, utilizing Redis and Django REST Framework for efficient implementation.","archived":false,"fork":false,"pushed_at":"2024-05-31T04:48:04.000Z","size":192,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:14:36.088Z","etag":null,"topics":["channels","channels-redis","django","django-rest-framework","djangochannelsrestframework","djangorestframework","python","redis","redis-cache","rest","rest-api","restapi","restful-api","websocket"],"latest_commit_sha":null,"homepage":"","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/shanathvemula.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-24T08:50:38.000Z","updated_at":"2024-08-13T17:40:23.000Z","dependencies_parsed_at":"2024-05-30T12:40:31.090Z","dependency_job_id":"460b0f9b-52ca-4519-92b6-b6f1fe251e11","html_url":"https://github.com/shanathvemula/test_djangoChannels","commit_stats":null,"previous_names":["shanathvemula/test_djangochannels"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanathvemula%2Ftest_djangoChannels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanathvemula%2Ftest_djangoChannels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanathvemula%2Ftest_djangoChannels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanathvemula%2Ftest_djangoChannels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanathvemula","download_url":"https://codeload.github.com/shanathvemula/test_djangoChannels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372945,"owners_count":21419722,"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":["channels","channels-redis","django","django-rest-framework","djangochannelsrestframework","djangorestframework","python","redis","redis-cache","rest","rest-api","restapi","restful-api","websocket"],"created_at":"2024-11-19T12:19:41.174Z","updated_at":"2025-04-23T04:49:50.267Z","avatar_url":"https://github.com/shanathvemula.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Blog Post APIs with Django Channels\n\n#### This project entails the acquisition of real-time data through Django Channels, utilizing Redis and Django REST Framework for efficient implementation.\n#### The utilization of the `djangochannelsrestframework` library was instrumental in shaping the project's framework. Leveraging its features, we seamlessly implemented a real-time, RESTful API infrastructure using Django Channels.\n#### Redis is an essential component of our project, ensuring unparalleled efficiency and speed by enabling lightning-fast data retrieval, seamless message brokering and cache management.\n## Setup\n\nThe first thing to do is to clone the repository:\n\n```sh\ngit clone https://--------------------\ncd test_djangoChannels\n```\n\nCreate a virtual environment to install dependencies in and activate it:\n\n```shell\n# Creating virtual environment\npython -m venv venv\n\n# In cmd.exe\nvenv\\Scripts\\activate.bat\n```\n\nThen install the dependencies:\n\n```shell\n(venv)$ pip install -r requirements.txt\n```\n\nNote the `(venv)` in front of the prompt. This indicates that this terminal\nsession operates in a virtual environment set up by `venv`.\n\nOnce `pip` has finished downloading the dependencies. \n\nDefault it will connect sqlite3 database.\nFor connecting Postgresql\n\n#### * Open settings.py in test_oauth2 folder\n\nRemove :\n\n```shell\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': BASE_DIR / 'db.sqlite3',\n    }\n}\n```\nAdd:\n```shell\nDATABASES = {\n    'default': {\n        'ENGINE': 'django_tenants.postgresql_backend',\n        'NAME': '\u003cDatabase Name\u003e',\n        'USER': '\u003cpostgres username\u003e',\n        'PASSWORD': '\u003cpostgres password\u003e',\n        'HOST': '\u003cpostgres host address\u003e',\n        'PORT': \u003cpostgres port\u003e\n    }\n}\n\n```\nProvide or change the redis configuration:\n```shell\nCHANNEL_LAYERS = {\n    \"default\": {\n        \"BACKEND\": \"channels_redis.core.RedisChannelLayer\",\n        \"CONFIG\": {\n            \"hosts\": [(\u003cHost\u003e, \u003cPort\u003e)],\n        },\n    },\n}\n```\n\nRun this commands in CMD:\n```shell\n(venv)$ python manage.py makemigrations\n(venv)$ python manage.py migrate\n(venv)$ python manage.py createsuperuser\nUsername (leave blank to use '---'): \u003cEnter username\u003e\nEmail address:\u003cEnter email address\u003e\nPassword: \u003cEnter Password\u003e\nPassword (again): \u003cEnter Password Again\u003e\n(venv)$ python manage.py runserver\n```\n\nAnd navigate to http://127.0.0.1:8000.\n\nEndpoints:\n```shell\n1. admin/\n2. post\n```\n\n## 1. admin/\n\nAdmin Panel\nhttp://127.0.0.1:8000/admin\n\n![img.png](static/README/admin.png)\n\n* To Login into Admin Panel\n\n## 2. post/\n\n* This Endpoint provides the CRUD Operations using request methods GET, POST, PUT, DELETE\n\n### I. GET Method\n\n* This Method helps to get the list of posts\n\n```shell\nURL : http://127.0.0.1:8000/post\nRequest Method: GET\n```\nExample cURL Code:\n\n```shell\ncurl --location 'http://127.0.0.1:8000/post'\n```\n\n### II.POST Method\n\n* This Method helps to create the post\n\n```shell\nURL : http://127.0.0.1:8000/user_create/\nRequest Method: POST\npayload:\n  {\n    \"author\": \"\u003cauthor name\u003e\",\n    \"title\": \"\u003cTitle\u003e\",\n    \"content\": \"\u003cContent\u003e\"\n }\n```\n\nExample cURL Code:\n\n```shell\ncurl --location 'http://127.0.0.1:8000/post' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"author\": \"\u003cauthor name\u003e\",\n    \"title\": \"\u003cTitle\u003e\",\n    \"content\": \"\u003cContent\u003e\"\n}'\n```\n\n### III. PUT Method\n\n* This Method helps to update the post\n\n* Here need to pass the data what are the fields to update \n\n```shell\nURL : http://127.0.0.1:8000/post\nRequest Method: PUT\npayload:\n  {\n    \"id\": \u003cpost id\u003e,\n    \"author\": \"\u003cauthor name\u003e\",\n    \"title\": \"\u003cTitle\u003e\",\n    \"content\": \"\u003cContent\u003e\"\n }\n```\n\nExample cURL Code:\n\n```shell\ncurl --location --request PUT 'http://127.0.0.1:8000/post' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"id\": \u003cpost id\u003e,\n    \"author\": \"\u003cauthor name\u003e\",\n    \"title\": \"\u003cTitle\u003e\",\n    \"content\": \"\u003cContent\u003e\"\n}'\n```\n\n### IV. DELETE Method\n\n* This Method helps to deleting post\n\n```shell\nURL : http://127.0.0.1:8000/post\nRequest Method: DELETE\npayload:\n  {\n    \"id\": \u003cpost id\u003e\n }\n```\n\nExample cURL Code:\n\n```shell\ncurl --location --request DELETE 'http://127.0.0.1:8000/post' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"id\": \u003cpost id\u003e\n}'\n```\n\n## Websocket\n\n![img.png](static/README/connected_to_scoket.png)\n\n* Once new post is created\n\n![img.png](static/README/post_is_created.png)\n\n* Once post is Updated\n\n![img.png](static/README/post_is_updated.png)\n\n* Once post is Deleted\n\n![img.png](static/README/post_is_deleted.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanathvemula%2Ftest_djangochannels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanathvemula%2Ftest_djangochannels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanathvemula%2Ftest_djangochannels/lists"}