Decorators

class django_facebook.decorators.FacebookRequired(fn, scope=None, canvas=False, page_tab=False, extra_params=None)[source]

Decorator which makes the view require the given Facebook perms, redirecting to the log-in page if necessary.

Note we don’t actually query the permissions, we just try in the view and upon a permission error redirect to login_url Querying the permissions would slow down things

authenticate(fn, request, *args, **kwargs)[source]

Authenticate the user

There are three options a.) We have permissions, proceed with the view b.) We tried getting permissions and failed, abort… c.) We are about to ask for permissions

authentication_failed(fn, request, *args, **kwargs)[source]

Execute the view but don’t pass the graph to indicate we couldn’t get the right permissions

get_redirect_uri(request)[source]

return the redirect uri to use for oauth authorization this needs to be the same for requesting and accepting the token

oauth_redirect(oauth_url, redirect_uri, e=None)[source]

Redirect to Facebook’s oAuth dialog

class django_facebook.decorators.FacebookRequiredLazy(fn, scope=None, canvas=False, page_tab=False, extra_params=None)[source]

Decorator which makes the view require the given Facebook perms, redirecting to the log-in page if necessary.

Based on exceptions instead of a permission check Faster, but more prone to bugs

Use this in combination with require_persistent_graph

django_facebook.decorators.facebook_required(fn=None, *decorator_args, **decorator_kwargs)

Decorator which makes the view require the given Facebook perms, redirecting to the log-in page if necessary.

Note we don’t actually query the permissions, we just try in the view and upon a permission error redirect to login_url Querying the permissions would slow down things

django_facebook.decorators.facebook_required_lazy(fn=None, *decorator_args, **decorator_kwargs)

Decorator which makes the view require the given Facebook perms, redirecting to the log-in page if necessary.

Based on exceptions instead of a permission check Faster, but more prone to bugs

Use this in combination with require_persistent_graph