2021-12-05 13:50:34 +01:00
|
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from django.urls import include
|
|
|
|
from django.urls import path
|
|
|
|
from users.views import UserModelViewSet
|
|
|
|
from rest_framework_simplejwt.views import TokenObtainPairView
|
|
|
|
from rest_framework_simplejwt.views import TokenRefreshView
|
2022-01-25 17:40:20 +01:00
|
|
|
from .views import PasswordReset, UserPasswordResetConfirmView, RegisterViewSet, login, logout, register, \
|
2022-01-27 23:21:11 +01:00
|
|
|
register_success, account, changeEmail, changeName, changePassword, resetPassword, resetPasswordConfirm,ResetPassword, \
|
|
|
|
ResetPasswordConfirm
|
2021-12-05 13:50:34 +01:00
|
|
|
|
|
|
|
|
2021-12-05 15:23:29 +01:00
|
|
|
router = DefaultRouter(trailing_slash=False)
|
2021-12-05 13:50:34 +01:00
|
|
|
router.register("items", UserModelViewSet)
|
2021-12-12 23:04:19 +01:00
|
|
|
# router.register("register", RegisterViewSet, basename="pyk")
|
2021-12-05 13:50:34 +01:00
|
|
|
|
|
|
|
urlpatterns = [
|
2021-12-05 15:23:29 +01:00
|
|
|
path("", include(router.urls)),
|
2021-12-20 19:40:24 +01:00
|
|
|
path('login', login, name='login'),
|
2021-12-15 16:46:50 +01:00
|
|
|
path('logout', logout, name='logout'),
|
|
|
|
path('register/success', register_success, name='register_success'),
|
|
|
|
path('register', register, name='register'),
|
2021-12-05 15:23:29 +01:00
|
|
|
path('api/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
|
|
|
path('api/token/refresh', TokenRefreshView.as_view(), name='token_refresh'),
|
2022-01-25 17:40:20 +01:00
|
|
|
#path("password/reset", PasswordReset.as_view(), name="resetPassword"),
|
|
|
|
#path("password/reset/confirm", UserPasswordResetConfirmView.as_view(), name="resetPasswordConfirm"),
|
2022-01-27 23:21:11 +01:00
|
|
|
path("password/reset", ResetPassword.as_view(), name="resetPassword"),
|
|
|
|
path("password/reset/confirm", ResetPasswordConfirm.as_view(), name="resetPasswordConfirm"),
|
2022-01-13 23:24:24 +01:00
|
|
|
path("email/change", changeEmail, name='changeEmail'),
|
|
|
|
path("name/change", changeName, name='changeName'),
|
2022-01-23 17:10:05 +01:00
|
|
|
path("password/change", changePassword, name='changePassword'),
|
2022-01-13 23:24:24 +01:00
|
|
|
path("account", account, name='account')
|
2021-12-05 13:50:34 +01:00
|
|
|
]
|
|
|
|
|