-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurls.py
More file actions
41 lines (37 loc) · 1.46 KB
/
urls.py
File metadata and controls
41 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
LoginView,
LogoutView,
RegisterView,
ProfileUpdateView,
SoftDeleteUserView,
AccessRoleRuleListCreateView,
AccessRoleRuleDetailView,
UserViewSet,
ProductViewSet,
StoreViewSet,
MockUsersView,
MockProductsView,
MockStoresView
)
router = DefaultRouter()
router.register(r'users', UserViewSet, basename='user')
router.register(r'products', ProductViewSet, basename='product')
router.register(r'stores', StoreViewSet, basename='store')
urlpatterns = [
# Authentication endpoints
path('auth/login/', LoginView.as_view(), name='login'),
path('auth/logout/', LogoutView.as_view(), name='logout'),
path('auth/register/', RegisterView.as_view(), name='register'),
path('auth/profile/', ProfileUpdateView.as_view(), name='update-profile'),
path('auth/delete/', SoftDeleteUserView.as_view(), name='soft-delete'),
# Access rules endpoints
path('access-rules/', AccessRoleRuleListCreateView.as_view(), name='access-rules'),
path('access-rules/<int:pk>/', AccessRoleRuleDetailView.as_view(), name='access-rule-detail'),
path('mock/users/', MockUsersView.as_view(), name='mock-users'),
path('mock/products/', MockProductsView.as_view(), name='mock-products'),
path('mock/stores/', MockStoresView.as_view(), name='mock-stores'),
# Include router URLs for viewsets
path('', include(router.urls)),
]