1from django.shortcuts import render
2import requests
3
4def github(request):
5 user = {}
6 if 'username' in request.GET:
7 username = request.GET['username']
8 url = 'https://api.github.com/users/%s' % username
9 response = requests.get(url)
10 user = response.json()
11 return render(request, 'core/github.html', {'user': user})