Exemplo n.º 1
0
def home(request):
    # build the client
    client = FindingsAPIClient(API_KEY, API_SECRET)
    clips = client.fetch_clips()
    # is there an existing saved token?
    try:
        access_token = AccessToken.objects.all()[0]
    except IndexError:
        access_token = None
    return render_to_response(
        "api.html", {
        "clips": clips,
        "auth_url": client.auth_url(),
        "access_token": access_token,
        },
        context_instance=RequestContext(request)
        )