Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Add facebook connect authentication to your Django website.

Project Description


This package adds facebook connect authentication to a Django web site. Many of the existing packages are either out of date, using soon to be deprecated facebook apis (along with out of date documentation), or simply do not work quite right.

This package is small, does not have external dependencies, and should “just work”.


You will need to create a Facebook application for facebook connect to work.

Set the “Site URL”, located in your facebook applications settings to:


Note: during development, you may set the above to localhost, e.g.

Next, install this package by running:

pip install django-facebook-connect

Configure the following settings in your

FACEBOOK_LOGIN_REDIRECT = “/” # (optional, defaults to “/”)

FACEBOOK_APP_ID = “<place your app id here>” # required

FACEBOOK_APP_SECRET = “<place your app secret code here>” # required

FACEBOOK_SCOPE = “email” # (optional, defaults to “email”)

Note: FACEBOOK_SCOPE determines what permissions facebook will ask from your users,
and in turn, give you access to. For example, your scope may look like: ‘read_stream,publish_stream,offline_access,user_photos’, whereas above we are only asking for email access. This package comes with the python_facebook_sdk included for retrieving user information - but does not gather more than the name and email at this time (perhaps in future versions).

Add “facebook_connect” to your list of installed apps:

INSTALLED_APPS = ( ‘facebook_connect’, )

And include faceboook_connect.urls within your

urlpatterns = pattern(‘’,

(r’^facebook_connect/’, include(‘facebook_connect.urls’)),


Finally, run:

python syncdb

Or, if you’re using South:

python schemamigration facebook_connect –initial

to create the initial migration, and

python migrate facebook_connect

to migrate the database.


These tags are now usable in your templates:

{% load facebook_connect %}

{% facebook_button %}

{% facebook_script %}

If you would like to override the default button (facebook_button tag), to choose a different image and have more control, you’ll need to trigger (on click) the ‘facebook_connect()’ function that starts the login process.


Inspiration was taken from this “django-facebookconnect” package: as well as the views/models responsible for the facebook –> django user mapping.

Security code for validating the signedRequest is by Sunil Arora:

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(10.5 kB) Copy SHA256 Hash SHA256
Source None Aug 7, 2012

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers