Giter Club home page Giter Club logo

django-facebookconnect's Introduction

How it works
============
If a connect login occurs and that facebook ID has never logged in to this site, a standard django.contrib.auth user is created, as well as a custom FacebookUser object that keeps track of the Facebook - Django user ID mappings. If the user has previously logged on, the corresponding Django user is used. The user is then logged in just like any regular Django user.
Setup

Install
=======

Start by creating a facebook application that your site will use for connect.

The important thing here is to get the 'Connect URL' right, which is under the 'Connect' tab. It will be http://<your-project's-address>/facebookconnect

In your django project that will be using connect, setup the following values in your settings.py (or wherever you keep your settings) (replace the xxxxxxxx with the correct values for your setup):

# where the user will go after they log in via facebook
LOGIN_REDIRECT_URL = '/blog/'
# the application api key given by facebook
FACEBOOK_API_KEY = 'xxxxxxxx'
# the application secret key given by facebook
FACEBOOK_APPLICATION_SECRET = 'xxxxxxxx'

# add the facebookconnect app to the list of apps.
INSTALLED_APPS = (
    ...
    'facebookconnect',
    ...
)

Include the facebook connect url file to your urls:

urlpatterns = pattern('',
   ...
   (r'^facebookconnect/', include('facebookconnect.urls'),
   ...
)

Usage
=====

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml">
<body>

<p>Login via facebook!</p>

{% load facebookconnect %}
{% facebook_connect_login_button %}

{% facebook_connect_script %}

</body>
</html>

django-facebookconnect's People

Contributors

teebes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.