-
Notifications
You must be signed in to change notification settings - Fork 0
ratty3697/Django-Example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
-->used inbuilt User model with 'rest_framework' to generate and validate token to identify user
-->both login & signup are API '/api/auth/login' & '/api/auth/signup' gives JsonObject Response
-->calling login api --> curl -X POST http://127.0.0.1:8000/api/auth/login --data 'username=yourusername&password=yourpassword'
-->calling signup api --> curl -X POST http://127.0.0.1:8000/api/auth/signup --data 'username=yourusername&password=yourpassword&email=your_email'
2.) 'posts' app
-->this app shows posts in sorted order according to their publishing date
-->to publish a post user must set Token(recieved after login) in header usnder 'Authorization' , it should be like this 'Token yourtoken'
-->calling add post api -->curl -X POST http://127.0.0.1:8000/api/post/add --data 'title=yourtitle&data=yourdata' --header 'Authorization:Token yourtoken'
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published