Skip to content

MaherSaif/django-account-chooser

 
 

Repository files navigation

django-account-chooser

Build Status Coverage Status

it is the django implementation of account chooser

Quick start

  1. Add "account_chooser" to your INSTALLED_APPS settings::
      INSTALLED_APPS = (
          ...
          'account_chooser',
      )
  1. Include the account_chooser URLconf in your project urls.py::
      url(r'^accounts/', include('account_chooser.urls')),
  1. add account-chooser middleware::
      MIDDLEWARE_CLASSES = (
            ...
            'account_chooser.middleware.AccountChooserMiddleware',
        )
  1. Configure account-chooser in the settings::

    There are a few configuration options to account_chooser that can be placed in a dictionary called ACCOUNT_CHOOSER_SETTINGS:

    • loginUrl

      default is getattr(settings, 'LOGIN_URL')

    • signupUrl

      default is '/accounts/signup/'

    • homeUrl

      where to redirect after account_chooser signin. default is getattr(settings, 'LOGIN_REDIRECT_URL')

    • siteEmailId

      Email input field ID (HTML "id=" attribute value) in the signup and login forms. default is 'email'

    • sitePasswordId

      Password input field ID in the signup and login forms. default is 'password'

    • siteDisplayNameId

      Display name input field ID in the signup form. Can be set to empty if your signup form does not need the user's name. default is ''

    • sitePhotoUrlId

      Profile photo URL input field ID in the signup form. Can be set to null or empty if your signup form does not need the user's profile picture. default is ''

    • uiConfig

      Values to use in customizing the appearance of the AccountChooser page. consult user interface customization for more details. default is ''

    • language

      The display language of the AccountChooser page. default is ''

    • providers

      Dict of supported Identity Providers and their login URLs. default is {}

    Example configuration::

     ACCOUNT_CHOOSER_SETTINGS = {
                       'signupUrl': '/accounts/register/',
                       'siteEmailId': 'id_email',
                       'sitePasswordId': 'id_password',
                       'siteDisplayNameId': 'id_username',
                       'sitePhotoUrlId': '',
                       'providers': {
                                     "facebook.com": '/facebook/connect',
                                     "twitter.com": '/twitter_auth',
                                     "google.com.com": '/gplus_auth',
                       },
     }
  2. Run the management command configureac to create the javascript file that manages ac.js::

      python manage.py configureac

About

it is the django implementation of account chooser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.3%
  • Shell 5.6%
  • JavaScript 1.1%