https://github.com/hackstarsj/djangorestapitutorial
DjangoRestApiTutorial
https://github.com/hackstarsj/djangorestapitutorial
Last synced: 10 months ago
JSON representation
DjangoRestApiTutorial
- Host: GitHub
- URL: https://github.com/hackstarsj/djangorestapitutorial
- Owner: hackstarsj
- Created: 2020-06-28T13:30:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-30T08:49:22.000Z (almost 6 years ago)
- Last Synced: 2025-04-22T17:42:42.206Z (about 1 year ago)
- Language: Python
- Size: 24.4 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FOR GET DATA in LIST EXAMPLE
curl http://127.0.0.1:8000/posts/
=====================================================
FOR POST DATA MEANS INSERT DATA in TABLE
curl -X PUT http://127.0.0.1:8000/posts/1/ -d post_title="Demo Post Updated" -d post_descripti
on="Demo Description Updated"
=========================================================
FOR UPDATE into TABLE BY ID
curl -X PUT http://127.0.0.1:8000/posts/1/ -d post_title="Demo Post Updated" -d post_descripti
on="Demo Description Updated"
=========================================================
FOR DELETE DATA DATA BY ID
curl -X DELETE http://127.0.0.1:8000/posts/1/
=========================================================
FOR SINGLE POST FETCH BY ID
curl http://127.0.0.1:8000/posts/1/
=================================================
For Alternate Method for Seprate POST,GET,PUT
FOR GET DATA in LIST EXAMPLE
curl http://127.0.0.1:8000/posts_2/
=====================================================
FOR POST DATA MEANS INSERT DATA in TABLE
curl -X PUT http://127.0.0.1:8000/posts_2/1/ -d post_title="Demo Post Updated" -d post_descripti
on="Demo Description Updated"
=========================================================
FOR UPDATE into TABLE BY ID
curl -X PUT http://127.0.0.1:8000/posts_2/1/ -d post_title="Demo Post Updated" -d post_descripti
on="Demo Description Updated"
=========================================================
FOR DELETE DATA DATA BY ID
curl -X DELETE http://127.0.0.1:8000/posts_2/1/
=========================================================
FOR SINGLE POST FETCH BY ID
curl http://127.0.0.1:8000/posts_2/1/
=================================================
TOKEN GENERATE for Authorized Access API
==================================================
FOR JSON WEB TOKEN GENERATE
curl -X POST http://127.0.0.1:8000/api/auth/token -d "username=admin" -d "password=admin"
=================================================
FOR Native TOKEN GENERATE
curl -X POST http://127.0.0.1:8000/token_generate/ -d "username=admin" -d "password=admin"
=================================================
FOR JWT TOKEN REFRESH
curl -X POST http://127.0.0.1:8000/api/auth/refresh -d "refresh=REFRESH TOKEN" -H "Authorization:ACCESS_TOKEN_JWT"
=================================================