mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-07-22 05:29:46 +03:00
Customization of including of user details urls
This commit is contained in:
parent
b56f909002
commit
04136c6e35
|
@ -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
|
||||
|
|
|
@ -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'),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user