it is the django implementation of account chooser
- Add "account_chooser" to your INSTALLED_APPS settings::
INSTALLED_APPS = (
...
'account_chooser',
)
- Include the account_chooser URLconf in your project urls.py::
url(r'^accounts/', include('account_chooser.urls')),
- add account-chooser middleware::
MIDDLEWARE_CLASSES = (
...
'account_chooser.middleware.AccountChooserMiddleware',
)
-
Configure account-chooser in the settings::
There are a few configuration options to
account_chooser
that can be placed in a dictionary calledACCOUNT_CHOOSER_SETTINGS
:-
loginUrl
default is
getattr(settings, 'LOGIN_URL')
-
signupUrl
default is
'/accounts/signup/'
-
homeUrl
where to redirect after
account_chooser
signin. default isgetattr(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', }, }
-
-
Run the management command configureac to create the javascript file that manages ac.js::
python manage.py configureac