settings: make the authentic social account provider non mandatory

This commit is contained in:
Benjamin Dauvergne 2014-05-26 22:52:38 +02:00
parent 9114b3b405
commit 7f8a95928c
1 changed files with 12 additions and 11 deletions

View File

@ -131,7 +131,6 @@ INSTALLED_APPS = (
'allauth.account',
'allauth.socialaccount',
# ... include the providers you want to enable:
'portail_citoyen2.allauth_authentic2',
'portail_citoyen2',
)
@ -142,17 +141,19 @@ AUTHENTICATION_BACKENDS = (
# auth and allauth settings
LOGIN_REDIRECT_URL = os.environ.get('LOGIN_REDIRECT_URL', '/')
LOGOUT_URL = os.environ.get('LOGOUT_URL', '/accounts/logout/')
LOGIN_URL = os.environ.get('LOGIN_URL', '/accounts/authentic2/login/?process=login')
SOCIALACCOUNT_QUERY_EMAIL = True
SOCIALACCOUNT_PROVIDERS = {
'authentic2': {
'URL': os.environ.get('AUTHENTIC2_URL', '') + '/idp/oauth2/',
'SCOPE': ['read', 'write'],
},
}
SOCIALACOUNT_AUTO_SIGNUP = True
if 'AUTHENTIC2_URL' in os.environ:
INSTALLED_APPS += ('portail_citoyen2.allauth_authentic2',)
LOGIN_URL = os.environ.get('LOGIN_URL', '/accounts/authentic2/login/?process=login')
SOCIALACCOUNT_QUERY_EMAIL = True
SOCIALACCOUNT_PROVIDERS = {
'authentic2': {
'URL': os.environ.get('AUTHENTIC2_URL', '') + '/idp/oauth2/',
'SCOPE': ['read', 'write'],
},
}
SOCIALACOUNT_AUTO_SIGNUP = True
ACCOUNT_LOGOUT_ON_GET = True
ACCOUNT_UNIQUE_EMAIL = False
ACCOUNT_UNIQUE_EMAIL = True
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'