On Mon, May 11, 2009 at 3:50 AM, laspal <amit.las...@gmail.com> wrote:

>
> Hi,
> I am trying to build facebook app but ran into problem.
>
> here is the code:
>
> [snip]from django.http import HttpResponse
> from django.views.generic.simple import direct_to_template
>
> import facebook.djangofb as facebook
>
> from fblaspal.models import FacebookUser
>
> @facebook.require_login()
> def canvas(request):
>    # Get the User object
>    user, created = FacebookUser.objects.get_or_create(id =
> request.facebook.uid)
>    user_lastname = request.facebook.users.getInfo
> ([request.facebook.uid], ['last_name'])[0]['last_name']
>
>
>
>    #  user new lang of choice
>    if 'language' in request.POST:
>        user.language = request.POST['language'][:64]
>        user.save()
>
>   # data = facebook.stream.get(request.facebook.uid, limit=80)
>    test = facebook.Friends.get(request.facebook.uid)
>
>    return direct_to_template(request, 'canvas.fbml', extra_context=
> {'fbuser': user,'user_lastname': user_lastname,})
>
> its working fine but the problem is i am not able to use facebook api.
>
> I tried using test = facebook.Friends.get(request.facebook.uid) which
> gives me 500 error code.
> can i get the example of how to use facebook api..
>
>
Django itself doesn' t include a facebook api so I'm not sure how much help
you will be able to get on this list.  I assume you are using this:

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

Have you tried the #facebook IRC channel mentioned there?

Your question is also a bit confusing to me, since first you say "it's
working fine" but then you say you get a 500 error if you use the facebook
api...however the code snippet above "it's working fine" looks to contain
exactly the same line of code you cite as causing a 500 error?

One thing I will suggest is that you set DEBUG to True in your settings.py
file, that way you will get a lot more information as to what is causing the
error than "500".

Karen

--~--~---------~--~----~------------~-------~--~----~
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