views:

225

answers:

2

hi, I am trying to develop facebook app using django.

The problem I am facing is how to use facebook api and get user friend list.

view.py

def canvas(request):
    # Get the User object 
    user, created = FacebookUser.objects.get_or_create(id = request.facebook.uid)
    return direct_to_template(request, 'canvas.fbml', extra_context={'fbuser': user,})

so it's working fine for me. I am getting user info in my page.

Welcome,<fb:name uid="{{ fbuser.id }}" firstnameonly="true" useyou="false" />!

this is canvas.fbml

Help needed.

Thanks.

A: 

Try using single quotes when loading up the userID etc.

Failing that it would appear to be either of the following - Output error from python. The HTML / FBML output should be as follows

  • Double check the attributes you are adding are correct. Case sensitive.

  • Are you loading you the correct authentication info (Keys) in this file? I'm assuming as its on the canvas its all ok. Test hte FBML in the FBML console.

steve
+1  A: 

have you checked out the official facebook docs:

http://wiki.developers.facebook.com/index.php/Python

the tutorial are pretty good and cover everything you need to know.

blackkettle