Skip to content

jpzk/django-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-Todo

This project is part of this tutorial how to implement a simple Todo REST API with Django, Django REST Framework and OAuth2.

Example

Register a User

curl -X POST -d 'username=jpzk&password=yourguess' \
http://localhost:8000/register/

Get Authentication Token

curl -X POST -d \
'username=jpzk&password=yourguess&grant_type=password&client_id=jpzk' \
http://localhost:8000/oauth2/access_token/
 
{"access_token": "41b59e8238bb418c1fc98cfc6f523dd1a7839a03", "token_type":
"Bearer", "expires_in": 2591999, "scope": "read"} 

Create a Todo

curl -X POST -H 'Content-Type: application/json' -H 'Authorization: bearer \
41b59e8238bb418c1fc98cfc6f523dd1a7839a03' -d '{"description":"bake a bread"}' \
http://localhost:8000/todos/ 

Get All Todos

curl -X GET -H 'Content-Type: application/json' \
-H 'Authorization: bearer 41b59e8238bb418c1fc98cfc6f523dd1a7839a03' \
http://localhost:8000/todos/

Update a Todo

curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: bearer 41b59e8238bb418c1fc98cfc6f523dd1a7839a03' \
-d '{"description":"bake a bread", "done":"True"}' \
http://localhost:8000/todos/1

About

A simple todo list REST JSON backend with OAuth2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy