Skip to content

ratty3697/Django-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-Example

this project contains some implementation of django concept

1.) token based login and signup using rest_framework of django
-->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

No packages published