mirror of
				https://github.com/Tivix/django-rest-auth.git
				synced 2025-11-04 17:47:35 +03:00 
			
		
		
		
	switch to using path() instead of deprecated url()
This commit is contained in:
		
							parent
							
								
									26482ccb2d
								
							
						
					
					
						commit
						140112927f
					
				| 
						 | 
				
			
			@ -1,21 +1,21 @@
 | 
			
		|||
from dj_rest_auth.views import (LoginView, LogoutView, PasswordChangeView,
 | 
			
		||||
                                PasswordResetConfirmView, PasswordResetView,
 | 
			
		||||
                                UserDetailsView)
 | 
			
		||||
from django.conf.urls import url
 | 
			
		||||
from django.urls import path
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
 | 
			
		||||
urlpatterns = [
 | 
			
		||||
    # URLs that do not require a session or valid token
 | 
			
		||||
    url(r'^password/reset/$', PasswordResetView.as_view(),
 | 
			
		||||
        name='rest_password_reset'),
 | 
			
		||||
    url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(),
 | 
			
		||||
        name='rest_password_reset_confirm'),
 | 
			
		||||
    url(r'^login/$', LoginView.as_view(), name='rest_login'),
 | 
			
		||||
    path('password/reset/', PasswordResetView.as_view(),
 | 
			
		||||
         name='rest_password_reset'),
 | 
			
		||||
    path('password/reset/confirm/', PasswordResetConfirmView.as_view(),
 | 
			
		||||
         name='rest_password_reset_confirm'),
 | 
			
		||||
    path('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'),
 | 
			
		||||
    path('logout/', LogoutView.as_view(), name='rest_logout'),
 | 
			
		||||
    path('user/', UserDetailsView.as_view(), name='rest_user_details'),
 | 
			
		||||
    path('password/change/', PasswordChangeView.as_view(),
 | 
			
		||||
         name='rest_password_change'),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
if getattr(settings, 'REST_USE_JWT', False):
 | 
			
		||||
| 
						 | 
				
			
			@ -24,6 +24,6 @@ if getattr(settings, 'REST_USE_JWT', False):
 | 
			
		|||
    )
 | 
			
		||||
 | 
			
		||||
    urlpatterns += [
 | 
			
		||||
        url(r'^token/verify/$', TokenVerifyView.as_view(), name='token_verify'),
 | 
			
		||||
        url(r'^token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'),
 | 
			
		||||
        path('token/verify/', TokenVerifyView.as_view(), name='token_verify'),
 | 
			
		||||
        path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
 | 
			
		||||
    ]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user