Some checks failed
Build And Test / build-and-push (push) Has been cancelled
- Presigned URL API 추가 (MinIO/S3 private 버킷 지원) - OpenTelemetry trace 설정 추가 (DEBUG=False 시 활성화) - requirements.txt에 opentelemetry 패키지 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.6 KiB
Python
45 lines
1.6 KiB
Python
# 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/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
|
|
|
|
# 댓글 관련 (포스트 하위 리소스)
|
|
path('posts/<int:post_pk>/', include(comment_router.urls)),
|
|
|
|
# 첨부파일 관련
|
|
path('posts/<int:post_pk>/attachments/',
|
|
AttachmentListCreateView.as_view(), name='attachment-list'),
|
|
path('posts/<int:post_pk>/attachments/<int:pk>/',
|
|
AttachmentDeleteView.as_view(), name='attachment-delete'),
|
|
|
|
# 임시 첨부파일 (게시글 작성 전 업로드)
|
|
path('attachments/upload/',
|
|
TempAttachmentUploadView.as_view(), name='temp-attachment-upload'),
|
|
path('attachments/<int:pk>/',
|
|
TempAttachmentDeleteView.as_view(), name='temp-attachment-delete'),
|
|
|
|
# Presigned URL (MinIO/S3)
|
|
path('presigned/<path:object_key>/',
|
|
PresignedUrlView.as_view(), name='presigned-url'),
|
|
]
|