def dashboard(request, mine=True, username=None):
    """
    User's HQ is where the user can get updates on the things that interest them
    and manage their creations.
    
    Not the same as the user's profile.
    
    """
    is_me = False
    if mine:
        if request.user.is_authenticated():
            the_user = request.user
            is_me = True
        else:
            return HttpResponseRedirect(settings.LOGIN_URL+'?next=%s' % request.path)
    else:
        the_user = get_object_or_404(User, username=username)
        if the_user == request.user:
            is_me = True
    
    subscriptions = Subscription.objects.filter(user=the_user)
    feeds = [sub.feed for sub in subscriptions]
    updates = Update.objects.filter(feed__in=feeds).order_by('-created')
    
    # Paginate the list
    paginator = Paginator(updates, 20) # Show 20 updates per page
    
    # Make sure page request is an int. If not, deliver first page.
    try:
        page = int(request.GET.get('page', '1'))
    except __HOLE__:
        page = 1

    # If page is out of range, deliver last page of results.
    try:
        updates = paginator.page(page)
    except (EmptyPage, InvalidPage):
        updates = paginator.page(paginator.num_pages)
    
    return render_to_response('dashboard/dashboard.html', {
        'the_user': the_user,
        'is_me': is_me,
        'subscriptions': subscriptions,
        'feeds': feeds,
        'updates': updates,
        }, context_instance=RequestContext(request)
    )
dataset/ETHPy150Open caseywstark/colab/colab/apps/dashboard/views.py/dashboard