diff --git a/docs/configuration.rst b/docs/configuration.rst index dbe965b..db7e2cd 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 diff --git a/rest_auth/urls.py b/rest_auth/urls.py index d753c44..866515f 100644 --- a/rest_auth/urls.py +++ b/rest_auth/urls.py @@ -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'), +)