Beispiel #1
0
from django.urls import path
from django.conf.urls import include
from rest_framework import routers
from api.views import TaskViewSets, CreateUserView, TaskListView, TaskRetriveView, PostListView, PostRetriveView

router = routers.DefaultRouter()
router.register("tasks", TaskViewSets, basename="tasks")

urlpatterns = [
    path("list-post/", PostListView.as_view(), name="list-post"),
    path("detail-post/<str:pk>/",
         PostRetriveView.as_view(),
         name="detail-post"),
    path("list-task/", TaskListView.as_view(), name="list-task"),
    path("detail-task/<str:pk>/",
         TaskRetriveView.as_view(),
         name="detail-task"),
    path("register/", CreateUserView.as_view(), name="register"),
    path("auth/", include("djoser.urls.jwt")),
    path("", include(router.urls)),
]
Beispiel #2
0
from django.urls import path
from django.conf.urls import include
from rest_framework import routers
from api.views import TaskViewSet, CreateUserView, TaskListView, TaskRetrieveView, \
    PostListView, PostRetrieveView

router = routers.DefaultRouter()
router.register('tasks', TaskViewSet, basename='tasks')

urlpatterns = [
    path('list-post/', PostListView.as_view(), name='list-post'),
    path('detail-post/<str:pk>/',
         PostRetrieveView.as_view(),
         name='detail-post'),
    path('list-task/', TaskListView.as_view(), name='list-task'),
    path('detail-task/<str:pk>/',
         TaskRetrieveView.as_view(),
         name='detail-task'),
    path('register/', CreateUserView.as_view(), name='register'),
    path('auth/', include('djoser.urls.jwt')),
    path('', include(router.urls)),
]
Beispiel #3
0
from django.urls import path
from api.views import TaskListView, TaskDetailView

urlpatterns = [
    path('task/', TaskListView.as_view(), name='api-task'),
    path('task/<str:pk>/', TaskDetailView.as_view(), name='api-task-detail')
]