def home(request):

    response_burst = bitly.burst()

    c = {
        'show_search_response': False,
        'response_burst': response_burst,
    }

    return render_to_response('index.html', c, context_instance=RequestContext(request))
def search(request):
    user_input = {}
    user_input['query'] = request.POST['query']
    user_input['location'] = request.POST['location']
    
    response_search = bitly.search(user_input)
    response_burst = bitly.burst()

    c = {
        'response_search': response_search,
        'response_burst': response_burst,
        'show_search_response': True,
        'response_found': len(response_search['data']['results']) > 0
        }

    return render_to_response('index.html', c, context_instance=RequestContext(request))