I am going nuts this should be simple but I keep getting a
verification error every time in my response in the following code. I
double checked my APP_ID and SECRET  I try the following code. I'm
using python2.5. Any help appreciated.

def login( request ):

    parms = { 'client_id': settings.FACEBOOK_APP_ID,
              'redirect_uri': 'http://' + request.get_host() +
request.get_full_path()
            }

    if 'code' in request.GET:
        parms['code'] = request.GET['code']
        parms['client_secret'] = settings.FACEBOOK_APP_SECRET
        url = 'https://graph.facebook.com/oauth/access_token?' +
urllib.urlencode(parms)

        response = urllib.urlopen(url).read()
        pdb.set_trace()
        response =cgi.parse_qs(response)

        if 'access_token' in response:
            access_token = response['access_token'][0]
            graph = GraphAPI( access_token )
            profile = graph.get_object("me")
            url = reverse('sites')
        url = reverse('sites')

    else:
        parms['scope'] = 'email,user_location'
        url = "https://graph.facebook.com/oauth/authorize?"; +
urllib.urlencode(parms)

    return HttpResponseRedirect(url)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to