Customization of including of user details urls

This commit is contained in:
eugena 2015-09-29 16:12:48 +05:00
parent b56f909002
commit 04136c6e35
2 changed files with 11 additions and 1 deletions

View File

@ -37,3 +37,6 @@ Configuration
- **NEW_PASSWORD_2_FIELD_ENABLED** - set it to False if you don't need new password confirmation (default: True)
- **USER_DETAILS_INCLUDED** - is user details urls are needed

View File

@ -1,5 +1,7 @@
from django.conf.urls import patterns, url
from django.conf import settings
from rest_auth.views import (
LoginView, LogoutView, UserDetailsView, PasswordChangeView,
PasswordResetView, PasswordResetConfirmView
@ -15,7 +17,12 @@ urlpatterns = patterns(
url(r'^login/$', LoginView.as_view(), name='rest_login'),
# URLs that require a user to be logged in with a valid session / token.
url(r'^logout/$', LogoutView.as_view(), name='rest_logout'),
url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'),
url(r'^password/change/$', PasswordChangeView.as_view(),
name='rest_password_change'),
)
if getattr(settings, 'USER_DETAILS_INCLUDED', True):
urlpatterns += patterns(
'',
url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'),
)