{"id":34502704,"url":"https://github.com/aditya-yadav134/task_api","last_synced_at":"2026-04-25T02:33:52.646Z","repository":{"id":329297661,"uuid":"1118931785","full_name":"aditya-yadav134/task_api","owner":"aditya-yadav134","description":"This is a RESTful API built using Django and Django Rest framework.","archived":false,"fork":false,"pushed_at":"2025-12-28T06:37:13.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-30T14:09:09.464Z","etag":null,"topics":["django","django-rest-framework","python","rest-api"],"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/aditya-yadav134.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T13:45:47.000Z","updated_at":"2025-12-28T06:37:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aditya-yadav134/task_api","commit_stats":null,"previous_names":["aditya-yadav134/task_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aditya-yadav134/task_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya-yadav134%2Ftask_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya-yadav134%2Ftask_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya-yadav134%2Ftask_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya-yadav134%2Ftask_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aditya-yadav134","download_url":"https://codeload.github.com/aditya-yadav134/task_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya-yadav134%2Ftask_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32247858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"online","status_checked_at":"2026-04-25T02:00:06.260Z","response_time":59,"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":["django","django-rest-framework","python","rest-api"],"created_at":"2025-12-24T02:19:32.579Z","updated_at":"2026-04-25T02:33:52.638Z","avatar_url":"https://github.com/aditya-yadav134.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Environment setup:\n- Install Python 3.10.2\n- Use any Code editor\n\n## Installation steps:\n- Open Terminal\u003cbr\u003e\n\n- Make a directory at any location and go inside directory \u003cbr\u003e\n    ``` mkdir \u003cdir_name\u003e \u0026\u0026 cd \u003cdir_name\u003e ```\u003cbr\u003e\n\n- Clone this repository \u003cbr\u003e\n    ```git clone https://github.com/aditya-yadav134/task_api.git ```\u003cbr\u003e\n\n- Go into 'task_api' directory :\u003cbr\u003e``` cd task_api ```\n\n- Install 'pipenv' for creating virtual environments and downloading required packages\u003cbr\u003e\n    ``` pip install pipenv ```\u003cbr\u003e\n\n- Create a virtual environment\u003cbr\u003e\n  ```pipenv shell```\u003cbr\u003e\n\n- Install all packages from __requirements.txt__ using pip\u003cbr\u003e\n    ```pipenv run pip install -r requirements.txt```\n\n- Run below command to check if any migrations to be applied \u003cbr\u003e\n    ```python manage.py makemigrations```\n\n- If any migrations shows then run the below command to migrate the database \u003cbr\u003e\n    ```python manage.py migrate```\n - Create a Admin user as follow __:__ \u003cbr\u003e\n    ```python manage.py createsuperuser```\n    \u003e Proide user name, email and password for successful account creation.\n\n- Run the server for testing the API \u003cbr\u003e\n    ```python manage.py runserver```\n\n\n ## Testing API in Postman  \n\n- Now I will be using __Postman__ to test the API. Go to official page of Postman to download it on your computer. \u003cbr\u003e\n\n - We will be using __\"Admin\"__ user to create 2-3 tasks so that we can test different endpoints \u003cbr\u003e\n \n - __Login using username and password used previously for __Admin__ user__ \u003cbr\u003e\n   \n   + In address bar select 'POST' and type url __:__  \u003cbr\u003e http://127.0.0.1:8000/api/auth/login    \n\n   + Click on 'Body' tab and enter following:\u003cbr\u003e\n        ```\n        {\n            \"username\" : \"Admin user name\",\n            \"password\" : \"Admin password\"\n        }\n        ```\n   + We will get __JWT tokens__ for login (access) and refresh\n       \n       ```\n       {\n         \"access\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ\", \n          \"refresh\": \"eyJ0b2tlbl90eXBlIjoicmVmcmVza\",\n          \"user\": {\n            \"pk\": 2,\n            \"username\": \"test\",\n            \"email\": \"\",\n            \"first_name\": \"\",\n            \"last_name\": \"\"\n            }\n      }\n      ```\n  \n- __Use JWT tokens in requests (with headers)__\n    \n    - In address bar select 'GET' and type url:\u003cbr\u003e\n     \" http://127.0.0.1:8000/api/tasks/\"\n    \n    - Click on 'Authorization' tab and enter following:\u003cbr\u003e\n           ```Type : Bearer Token\n           ```\u003cbr\u003e\n           ```Token : Paste access token value from the previous step for this user\n           ```\n    \n    - We will get all tasks made by this user __:__\u003cbr\u003e\n        ```\n             {\n                \"id\": 7,\n                \"title\": \"Task 5\",\n                \"description\": \"Task 5 modified by admin\",\n                \"status\": true,\n                \"owner\": 3\n              }\n        ```  \n- __Register a user :__\u003cbr\u003e\n      \n    + In address bar select 'POST' and type url __:__ \u003cbr\u003e \n     __http://127.0.0.1:8000/api/auth/register/__\n\n    + Click on __Body__ tab and enter following: \u003cbr\u003e\n        ``` \n             {\n              \"username\" : \"test2\",\n              \"password1\" : \"Vartak2025\"\n              \"password2\" : \"Vartak2025\"\n             }\n\n        ```\n    + Click __Send__ and we will get respose similar to this __:__ \u003cbr\u003e\n        ```     \n            {\n                \"access\" : \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\" ,\n                 \"refresh\": \"e0.Me6-V8Nv8PWco5AQDs8JU7f4DtbYfcelgGtcIRgjK8U\" ,\n                 \"user\": {\n                            \"pk\": 5,\n                            \"username\": \"test3\",\n                            \"email\": \"\",\n                            \"first_name\": \"\",\n                            \"last_name\": \"\"\n                         }\n             } \n        ```\n  \n  ## Setting up in Docker \n    ### Pull the image\n        docker pull adityayadav134/task_api:1.0\n    \n    ### Run container using Docker Compose\n        docker compose -f compose.yaml up -d\n        \n  ## List of all main API endpoints\n  \n  ### 1.  Authentication: \u003cbr\u003e\n    \n    + **POST** ```/api/auth/register/``` **:** \u003cbr\u003e\n             Takes username, password1, password2 and give response containing values for __access__ and __refresh__ token \u003cbr\u003e\n             \n    +   **POST** ```/api/auth/login/``` **:** \u003cbr\u003e\n              Takes username, password and match values on server if correct give response containing values for __access__ and __refresh__  token \u003cbr\u003e  \n    \n    +   **POST** ```/api/auth/logout/``` **:** \u003cbr\u003e\n              Logout user from API by destroying access token on the server \u003cbr\u003e\n    \n    +   **POST** ```/api/auth/refresh/``` **:** \u003cbr\u003e\n              Takes 'refresh' token value and server validates it and response with new value for 'access' token \u003cbr\u003e\n\n  ### 2.   __Tasks__ : \u003cbr\u003e\n    \n    *   **GET** ```/api/tasks/``` : \u003cbr\u003e\n        List all the __Tasks__ created if user is __Admin__ otherwise list all tasks of that user.\n\n    *   **POST** ```/api/tasks/``` : \u003cbr\u003e\n      Creates a new tasks and also set owner of task to current user\n\n    *   **GET** ```/api/tasks/\u003cid\u003e/``` : \u003cbr\u003e\n      Return response containing values for attributes of \"Task\".\n\n    *   **PUT/PATCH** ```/api/tasks/\u003cid\u003e/``` : \u003cbr\u003e\n      \n        + **PUT** :- Updates values of __Tasks__ object from data contained in the request. \u003cbr\u003eIf values for some attributes are provided then those attributes will get updated other values remain the same. \u003cbr\u003e\n      \n        +  **PATCH** :- Updates __Tasks__ object completely. If some attribute values are not present in the request then __Tasks__ will have empty values for those attributes.\n\n    *   **DELETE** ```/api/tasks/\u003cid\u003e/``` :- \u003cbr\u003e\n        Delete the __Task__ from the database. \n        This only happens if requesting User is __Admin__ or tasks is created by him.\n       \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-yadav134%2Ftask_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya-yadav134%2Ftask_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-yadav134%2Ftask_api/lists"}