Created
May 20, 2015 22:07
-
-
Save shofetim/3255d2f23f50b1979389 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def login(request): | |
| try: | |
| payload = json.loads(request.body) | |
| except ValueError as error: | |
| return JsonResponse.bad_request(message=unicode(error)) | |
| username = payload.get('username', False) | |
| password = payload.get('password', False) | |
| if username and password: | |
| else: | |
| return JsonResponse.bad_request(message=unicode('Malformed request')) | |
| return JsonResponse(data={'success':True}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment