1
You should pass the username in the url as you are doing in other cases.
So your template would change to
<a href="/builds/request_sent/{{abuild.user.username}}">
urls.py would change to
url(r'^request_sent/(?P<username>\w+)$', photo.views.friend_add),
And then view would change to
def friend_add(request, username):
if 'username' in request.GET:
....
Source:stackexchange.com