Some checks failed
Build And Test / build-and-push (push) Failing after 1m1s
- Post 모델 개선 (author_id, updated_at, view_count 등) - Tag 모델 및 태그 기능 추가 - 댓글 기능 추가 - API 확장 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
23 lines
775 B
Python
23 lines
775 B
Python
# blog/urls.py
|
|
|
|
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)),
|
|
]
|