Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Django Application for integrating Facebook Graph api
tree: 5add830963

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
fb
README
facebook.py

README

Django Application for integrating Facebook Graph api.

Authentication backend is created which can be used to authenticateai Facebook users using the
django plugabble authentication system.

Also, for every user a Django Auth user is created which can be used to give a login credentials
other then facebook to the users too. Hence both the auth mechanism can work hand in hand.


Requires:
python 2.5+
facebook.py (Facebook Python Graph API SDK) 
available with this distribution


setting.py

SESSION_COOKIE_DOMAIN = <your domain for cookies>
SESSION_COOKIE_AGE = 7200    # as of now its kept as 2 hours  which is default expiry of Facebook access_token

HOST = <full domain of application: ex "http://www.google.com">

INSTALLED_APPS += (
'django.contrib.auth',
'django.contrib.sessions',
)

FACEBOOK_API_KEY=
FACEBOOK_APP_ID=
FACEBOOK_SECRET_KEY=

FB_AUTH_REDIRECT = "<specify absolute url where client will be redirect after succesfull login, default redirection is  to '/'>"

AUTHENTICATION_BACKENDS =  ('django.contrib.auth.backends.ModelBackend','fb.auth.FbAuth')

FB_PERM = ["publish_stream","offline_access","user_location","user_birthday","email"]
(this settings is used to pull various fb extended permissions while authenticating with facebook oauth. please check.
http://developers.facebook.com/docs/authentication/permissions)


urls.py
add one url param:
(r'^fb/', include('fb.urls')),



site url for facebook app:
http://yourdomain.com/fb/fb-auth/
Something went wrong with that request. Please try again.