Giter VIP home page Giter VIP logo

django-socialregistration's Introduction

Django Social Registration

Django Social Registration enables developers to add alternative registration methods based on third party sites.

Requirements

django oauth python-openid pyfacebook

Installation

  1. Add the socialregistration directory to your PYTHON_PATH.
  2. Add socialregistration to your INSTALLED_APPS settings of Django.
  3. Add socialregistration.urls to your urls.py file.

Configuration

Facebook Graph API Connect ----------------#. The previous connect will be deprecated in further releases for now it's still available. #. This new version will support desktop as well as mobile. Use FACEBOOK_DISPLAY in your settings file to serve the different platforms. Possibilities: (touch, wap, default: popup) #. Add FACEBOOK_APP_ID and FACEBOOK_SECRET_KEY to your settings file representing the app id and the secret key you were given by Facebook. #. Add socialregistration.auth.FacebookAuth to AUTHENTICATION_BACKENDS in your settings file. #. Add tags to your template file:

{% load facebook_tags %} 
{% facebook_button %}

Twitter

  1. Add the following variables to your settings.py file with the values you were given by Twitter:

    TWITTER_CONSUMER_KEY
    TWITTER_CONSUMER_SECRET_KEY
    TWITTER_REQUEST_TOKEN_URL
    TWITTER_ACCESS_TOKEN_URL
    TWITTER_AUTHORIZATION_URL
  2. Add socialregistration.auth.TwitterAuth to AUTHENTICATION_BACKENDS in your settings file.
  3. Add tags to your template file:

    {% load twitter_tags %}
    {% twitter_button %}

LinkedIn -------#. Add the following variables to your settings.py file with the values you were given by LinkedIn:

LINKEDIN_CONSUMER_KEY
LINKEDIN_CONSUMER_SECRET_KEY
LINKEDIN_REQUEST_TOKEN_URL
LINKEDIN_ACCESS_TOKEN_URL
LINKEDIN_AUTHORIZATION_URL
  1. Add socialregistration.auth.LinkedinAuth to AUTHENTICATION_BACKENDS in your settings file.
  2. Add tags to your template file:

    {% load linkedin_tags %}
    {% linkedin_button %}

Other OAuth Services

There is an example of how FriendFeed integration could work. socialregistration.models provides a FriendFeedProfile model to save account data, socialregistration.auth provides examples for different auth backends for different service providers, socialregistration.utils provides a Twitter and FriendFeed interface and socialregistration.urls provides examples based on Twitter and FriendFeed how to hook in more OAuth based services.

OpenID

  1. Add socialregistration.auth.OpenIDAuth to AUTHENTICATION_BACKENDS in your settings file.
  2. Add tags to your template file:

    {% load openid_tags %}
    {% openid_form %}

Logging users out

You can use the standard {% url auth_logout %} url to log users out of Django. Please note that this will not log users out of third party sites though. When using Facebook Connect, it is recommended to follow the FBConnect developer wiki. See: http://wiki.developers.facebook.com/index.php/Connect/Authorization_Websites#Logging_Out_Users :

<a href="#" onclick="FB.Connect.logoutAndRedirect('{% url auth_logout %}')">Logout</a>

HTTPS

If you wish everything to go through HTTPS, set SOCIALREGISTRATION_USE_HTTPS in your settings file to True

Other Information

If you don't wish your users to be redirected to the setup view to create a username but rather have a username generated for them, set SOCIALREGISTRATION_GENERATE_USERNAME in your settings file to True

django-socialregistration's People

Contributors

aljosa avatar devioustree avatar flashingpumpkin avatar pinda avatar schuyler1d avatar statico avatar wunki avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

wnyc

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.