def user_page(request, user):
 user = get_object_or_404(User, username=user)
 profile = Profile.objects.get_or_create(user=user)[0]
 all_changes = Change.objects.last_changes(request.user).filter(user=user)
 last_changes = all_changes[:10]
 user_projects_ids = set(all_changes.values_list(u'translation__subproject__project', flat=True))
 user_projects = Project.objects.filter(id__in=user_projects_ids)
 return render(request, u'accounts/user.html', {u'page_profile': profile, u'page_user': user, u'last_changes': last_changes, u'last_changes_url': urlencode({u'user': user.username.encode(u'utf-8')}), u'user_projects': user_projects})

def user_page ( request , user ) : user = get_object_or_404 ( User , username = user ) profile = Profile . objects . get_or_create ( user = user ) [ 0 ] all_changes = Change . objects . last_changes ( request . user ) . filter ( user = user ) last_changes = all_changes [ : 10 ] user_projects_ids = set ( all_changes . values_list ( u'translation__subproject__project' , flat = True ) ) user_projects = Project . objects . filter ( id__in = user_projects_ids ) return render ( request , u'accounts/user.html' , { u'page_profile' : profile , u'page_user' : user , u'last_changes' : last_changes , u'last_changes_url' : urlencode ( { u'user' : user . username . encode ( u'utf-8' ) } ) , u'user_projects' : user_projects } )
user details page .