accounts/apps/users/urls.py
Sayyid Hamid Mahdavi 7ad52c59a4 test
2026-07-11 09:53:07 +03:30

31 lines
1.7 KiB
Python

from django.urls import path
from django.contrib.auth.views import LogoutView
from rest_framework.routers import DefaultRouter
from .views import UserListView, UserPublicRetrieveView, AccountView, RequestOTPView, ChangePasswordView, \
OTPLoginView, ProfileDetailView, ProfileUpdateView, RequestOTTView, UserCurrentAvatarUrlView, UserInquiryView, \
UserDetailedRetrieveView, UserSessionListView, UserProfileView, UserViewSet
app_name = "users"
router = DefaultRouter()
router.register("user", UserViewSet, basename="user")
urlpatterns = [
path('login/', OTPLoginView.as_view(), name='login'),
path('logout/', LogoutView.as_view(), name='logout'),
path('account/', ProfileDetailView.as_view(), name='account_detail'),
path('account/update/', ProfileUpdateView.as_view(), name='account_update'),
path('api/account/', AccountView.as_view(), name='account_api'),
path('api/users/all', UserListView.as_view(), name='user_list_api'),
path('api/users/', UserProfileView.as_view(), name='user_profile_list_api'),
path('api/sessions/', UserSessionListView.as_view(), name='user_sessions_api'),
path('api/users/<uuid>/', UserPublicRetrieveView.as_view(), name='user_public_retrieve_api'),
path('api/users/<uuid>/avatar', UserCurrentAvatarUrlView.as_view(), name='user_avatar_api'),
path('api/users/<uuid>/details', UserDetailedRetrieveView.as_view(), name='user_detailed_retrieve_api'),
path('api/request_otp/', RequestOTPView.as_view(), name='request_otp_api'),
path('api/request_ott/', RequestOTTView.as_view(), name='request_ott_api'),
path('api/change_password/', ChangePasswordView.as_view(), name='change_password_api'),
path('api/inquiry/', UserInquiryView.as_view(), name='user_inquiry_api'),
] + router.urls