I m trying to parse github using python, but its throwing the exception
the JSON object must be str, not 'bytes'
def profile(request):
jsonList = []
req = requests.get('https://api.github.com/users/DrkSephy')
jsonList.append(json.loads(req.content))
parsedData = []
userData = {}
for data in jsonList:
userData['name'] = data['name']
userData['blog'] = data['blog']
userData['email'] = data['email']
userData['public_gists'] = data['public_gists']
userData['public_repos'] = data['public_repos']
userData['avatar_url'] = data['avatar_url']
userData['followers'] = data['followers']
userData['following'] = data['following']
parsedData.append(userData)
return HttpResponse(str(parsedData, 'utf-8'))
How to solve it, i m using python 3.5.1 and Django 1.9.6