Files
CODE_ASSISTANT/5_django_backend/config/urls.py
T
lee-hyeon-cheolandClaude Fable 5.1 d4a5f20787 feat: 관리자 대시보드 — 토큰·비용·응답시간 집계 API + 앱 /admin 페이지
- backend apps/stats: GET /api/v1/admin/stats?from&to → totals / byUser / byDay. ChatMessage(assistant) 집계만, is_superuser 아니면 403. 테스트 3개
- frontend features/admin: 요약 카드 4개(요청·토큰·비용·평균 응답), 일별 토큰 막대(div), 사용자별 표, 기간 프리셋(오늘/7/30/90일). 헤더에 ADMIN 만 아이콘. 테스트 2개

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 13:39:06 +09:00

27 lines
892 B
Python

"""최상위 URL — 프론트 VITE_API_BASE_URL(/api/v1) 아래에 매닮."""
from django.conf import settings
from django.contrib import admin
from django.http import JsonResponse
from django.urls import include, path
from apps.accounts.views import MeView
from common.envelope import envelope
def health(_request):
return JsonResponse(
envelope(success=True, status_code=200, data={"app": settings.APP_NAME, "version": settings.APP_VERSION})
)
urlpatterns = [
path("admin/", admin.site.urls),
path("api/v1/health", health),
path("api/v1/auth/", include("apps.accounts.urls")),
path("api/v1/users/me", MeView.as_view()),
path("api/v1/chat/", include("apps.chat.urls")),
path("api/v1/admin/", include("apps.stats.urls")), # 관리자 대시보드 집계
path("", include("apps.gateway.urls")), # /api/ito/* — 사내 LLM(FabriX) 중계
]