Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

This and that

  • Loading branch information...
commit d1bcb6fa00244688e882ef6fdaa28d92c46bf0c3 1 parent 79c742f
@jgorset authored
Showing with 16 additions and 7 deletions.
  1. +11 −2 README.rst
  2. +5 −5 docs/source/usage/authorization.rst
View
13 README.rst
@@ -9,13 +9,22 @@ Fandjango makes it really easy to create Facebook applications with Django.
Usage
-----
-::
+You can require users to authorize your application by decorating views
+with ``facebook_authorization_required``::
@facebook_authorization_required
def greet(request):
return HttpResponse('Hi, %s!' % request.facebook.user.first_name)
-If you'd like to create an application that's a little more elaborate, you should
+You can prompt the user to grant your application privileges besides the defaults
+by providing the decorator with a list of permissions::
+
+ @facebook_authorization_required(permissions=['user_photos', 'user_relationships'])
+ def stalk(request):
+ for photo in request.facebook.user.graph.get("me/photos"):
+ screensaver.add(photo)
+
+If you'd like to create an application that's a little more elaborate (or a little less creepy), you should
`read the documentation <http://readthedocs.org/docs/fandjango>`_.
Installation
View
10 docs/source/usage/authorization.rst
@@ -3,8 +3,8 @@
Authorization
=============
-You may require users to authorize your application with the ``facebook_authorization_required``
-decorator::
+You can require users to authorize your application by decorating views with
+``facebook_authorization_required``::
from fandjango.decorators import facebook_authorization_required
@@ -16,10 +16,10 @@ decorator::
`Facebook's documentation on authorization <http://developers.facebook.com/docs/authentication/>`_
-You may govern which permissions the application requests by default by configuring the
+You can govern which permissions the application requests by default by configuring the
``FACEBOOK_APPLICATION_INITIAL_PERMISSIONS`` setting::
- FACEBOOK_APPLICATION_INITIAL_PERMISSIONS = ['read_stream', publish_stream']
+ FACEBOOK_APPLICATION_INITIAL_PERMISSIONS = ['read_stream', 'publish_stream']
.. admonition:: See also
@@ -30,7 +30,7 @@ You can request permissions besides the defaults by passing a list of permission
from fandjango.decorators import facebook_authorization_required
- @facebook_authorization_required(permissions=["user_events", "user_checkins"])
+ @facebook_authorization_required(permissions=['user_photos', 'user_relationships'])
def stalk(request):
...
Please sign in to comment.
Something went wrong with that request. Please try again.