tschellenbach/Django-facebook — Issue #58: Canvas page
Author: assotut
Created: 2011-11-09 06:26:23+00:00
State: open

django_facebook.views.canvas method doesn't pass facebook object in context to canvas template
and has invalid api call to open_facebook.
I changed it to something like:

```

def canvas(request):
context = RequestContext(request)

context['auth_url'] = generate_oauth_url()
fb = get_persistent_graph(request)
context['facebook'] = fb # <---- pass facebook obj with context
if fb.is_authenticated():
likes = context['facebook'].get("me/likes", limit=3) # <----- fix open_facebook call
logger.info('found these likes %s', likes)

return render_to_response('django_facebook/canvas.html', context)

```

Also django_facebook.canvas.generate_oauth_url doesn't work good with
facebook_settings.FACEBOOK_DEFAULT_SCOPE if it's defined as list.
Worked for me only after change to simple string:
FACEBOOK_DEFAULT_SCOPE = 'user_about_me, email, user_birthday'