Skip to content

Instantly share code, notes, and snippets.

@BoyanXu
Created November 25, 2020 09:32
Show Gist options
  • Save BoyanXu/cce08ea1798e3099b3cae65b5eb11f87 to your computer and use it in GitHub Desktop.
Save BoyanXu/cce08ea1798e3099b3cae65b5eb11f87 to your computer and use it in GitHub Desktop.
login api
@api_view(['POST'])
def login(request):
"""
PATH:
`localhost:8000/api/login/`
Description:
Login request handler.
Request Format: (JSON)
{ username: "frank",
password: "frank" }
Response Status:
200: Success
401: `password` doesn't match the `username`
404: `username` not found
Response Format: (JSON)
{ id: 1,
username: "frank",
password: "frank",
role : "patient", ..} (including all the personal_info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment