handling authentication through django-mellon
This commit is contained in:
parent
8fd7999042
commit
700b2afb0a
|
@ -95,3 +95,16 @@ RSS_TITLE = 'Announces'
|
|||
RSS_DESCRIPTION = ''
|
||||
RSS_LINK = ''
|
||||
RSS_LINK_TEMPLATE = '/#announce{0}'
|
||||
|
||||
# django-mellon settings
|
||||
MELLON_ATTRIBUTE_MAPPING = {
|
||||
'username': '{attributes[username][0]}',
|
||||
'email': '{attributes[email][0]}',
|
||||
'first_name': '{attributes[first_name][0]}',
|
||||
'last_name': '{attributes[last_name][0]}',
|
||||
}
|
||||
|
||||
if 'mellon' in INSTALLED_APPS:
|
||||
AUTHENTICATION_BACKENDS = ('mellon.backends.SAMLBackend', )
|
||||
LOGIN_URL = 'mellon_login'
|
||||
LOGOUT_URL = 'mellon_logout'
|
||||
|
|
|
@ -15,9 +15,19 @@ urlpatterns = patterns('',
|
|||
url(r'^manage/', decorated_includes(manager_required,
|
||||
include(manage_urls))),
|
||||
url(r'^ckeditor/', include('ckeditor.urls')),
|
||||
url('^accounts/', include('django.contrib.auth.urls')),
|
||||
url(r'^admin/', include(admin.site.urls))
|
||||
)
|
||||
|
||||
if 'mellon' in settings.INSTALLED_APPS:
|
||||
# authentication with django-mellon
|
||||
urlpatterns += patterns('',
|
||||
url(r'^accounts/mellon/', include('mellon.urls')),
|
||||
)
|
||||
else:
|
||||
urlpatterns += patterns('',
|
||||
url('^accounts/', include('django.contrib.auth.urls')),
|
||||
)
|
||||
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
|
Reference in New Issue