Created
November 25, 2020 09:32
-
-
Save BoyanXu/cce08ea1798e3099b3cae65b5eb11f87 to your computer and use it in GitHub Desktop.
login api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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