28 lines
1.2 KiB
Python
28 lines
1.2 KiB
Python
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
|
|
from .views import PasswordReset, UserPasswordResetConfirmView, RegisterViewSet, login, logout, register, register_success, loginn, login_success
|
|
|
|
|
|
router = DefaultRouter(trailing_slash=False)
|
|
router.register("items", UserModelViewSet)
|
|
# router.register("register", RegisterViewSet, basename="pyk")
|
|
|
|
urlpatterns = [
|
|
path("", include(router.urls)),
|
|
path('login', loginn, name='login'),
|
|
path('logout', logout, name='logout'),
|
|
path('register/success', register_success, name='register_success'),
|
|
path('login/success', login_success, name='login_success'),
|
|
# path('register', RegisterViewSet.as_view(), name='register'),
|
|
path('register', register, name='register'),
|
|
path('api/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
|
path('api/token/refresh', TokenRefreshView.as_view(), name='token_refresh'),
|
|
path("password/reset", PasswordReset.as_view()),
|
|
path("password/reset/confirm", UserPasswordResetConfirmView.as_view()),
|
|
]
|
|
|