- Post 모델 개선 (author_id, updated_at, view_count 등) - Tag 모델 및 태그 기능 추가 - 댓글 기능 추가 - API 확장 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
16
blog/urls.py
16
blog/urls.py
@ -1,10 +1,22 @@
|
||||
# blog/urls.py
|
||||
|
||||
from django.urls import path
|
||||
from .views import PostListView, PostListCreateView, PostDetailView
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from .views import PostListView, PostListCreateView, PostDetailView, CommentViewSet, TagListView
|
||||
|
||||
# 댓글 라우터
|
||||
comment_router = DefaultRouter()
|
||||
comment_router.register(r'comments', CommentViewSet, basename='comment')
|
||||
|
||||
urlpatterns = [
|
||||
# 태그 관련
|
||||
path('tags/', TagListView.as_view(), name='tag-list'),
|
||||
|
||||
# 포스트 관련
|
||||
path('posts/', PostListView.as_view(), name='post-list'),
|
||||
path('create/', PostListCreateView.as_view(), name='post-list-create'),
|
||||
path('posts/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
|
||||
|
||||
# 댓글 관련 (포스트 하위 리소스)
|
||||
path('posts/<int:post_pk>/', include(comment_router.urls)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user