Facebook-auth is an easy to setup facebook authentication/registration mechanism with support for the Django Framework
-
Installation:
pip install git+https://github.com/technoarch-softwares/facebook-auth -
Add
"facebook_login"to yourINSTALLED_APPSsetting like this::INSTALLED_APPS = (
... 'facebook_login',)
-
Add this lines to your project settings file:
SITE_URL = 'SITE DOMIAN' #like 'http://localhost:8000/'ERROR_REDIRECT_URL = 'SITE LOGIN URL'FACEBOOK_REDIRECT_URL = 'facebook/authentication' -
Add Facebook Secret Keys and Client Id
FACEBOOK_CLIENT_ID = 'FACEBOOK API KEY'`FACEBOOK_CLIENT_SECRET = 'FACEBOOK API SECRET'``
-
Include the
facebook_loginURLconf in your project urls.py like this::url(r'^facebook/', include('facebook_login.urls')), -
Run
python manage.py migrateto create thefacebook_loginmodels. -
Add the permissions in your settings file like this
FACEBOOK_EXTENDED_PERMISSIONS = ['email']
-
It will create a table into database named by
facebook_login_facebookprofile. -
Visit http://127.0.0.1:8000/facebook/ to participate in the facebook authentication.
#Features
-
Access the Facebook API, from Your website (Using OAuth)
-
Django User Registration (Convert Facebook user data into a user model)
-
Store user data locally.
-
Facebook FQL access
-
Automated reauthentication (For expired tokens)
-
Data Saved in
facebook_login_facebookprofiletable