Files
msa-django-blog/blog/urls.py
icurfer 2cc9472c7a
Some checks failed
Build And Test / build-and-push (push) Failing after 1m1s
v0.0.7 | 블로그 기능 개선
- Post 모델 개선 (author_id, updated_at, view_count 등)
- Tag 모델 및 태그 기능 추가
- 댓글 기능 추가
- API 확장

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 00:33:05 +09:00

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)),
]