from django urls import include path from rest_framework import router

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from django.urls import include, path
from rest_framework import routers
from posts.views import (
api_detail_post_view,
api_create_post_view,
api_update_post_view,
api_delete_post_view,
)
app_name = 'posts'
urlpatterns = [
path('<int:post_id>/', api_detail_post_view, name="detail"),
path('<int:post_id>/update/', api_update_post_view, name="update"),
path('create/', api_create_post_view, name="create"),
path('<int:post_id>/delete/', api_delete_post_view, name="delete"),
]