# blog/urls.py from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import ( PostListView, PostListCreateView, PostDetailView, CommentViewSet, TagListView, AttachmentListCreateView, AttachmentDeleteView, TempAttachmentUploadView, TempAttachmentDeleteView, PresignedUrlView ) # 댓글 라우터 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//', PostDetailView.as_view(), name='post-detail'), # 댓글 관련 (포스트 하위 리소스) path('posts//', include(comment_router.urls)), # 첨부파일 관련 path('posts//attachments/', AttachmentListCreateView.as_view(), name='attachment-list'), path('posts//attachments//', AttachmentDeleteView.as_view(), name='attachment-delete'), # 임시 첨부파일 (게시글 작성 전 업로드) path('attachments/upload/', TempAttachmentUploadView.as_view(), name='temp-attachment-upload'), path('attachments//', TempAttachmentDeleteView.as_view(), name='temp-attachment-delete'), # Presigned URL (MinIO/S3) path('presigned//', PresignedUrlView.as_view(), name='presigned-url'), ]