Files
thrillwiki_django_no_react/backend/apps/api/v1/urls.py
pacnpal 67db0aa46e feat(rides): populate slugs for existing RideModel records and ensure uniqueness
- Added migration 0011 to populate unique slugs for existing RideModel records based on manufacturer and model names.
- Implemented logic to ensure slug uniqueness during population.
- Added reverse migration to clear slugs if needed.

feat(rides): enforce unique slugs for RideModel

- Created migration 0012 to alter the slug field in RideModel to be unique.
- Updated the slug field to include help text and a maximum length of 255 characters.

docs: integrate Cloudflare Images into rides and parks models

- Updated RidePhoto and ParkPhoto models to use CloudflareImagesField for image storage.
- Enhanced API serializers for rides and parks to support Cloudflare Images, including new fields for image URLs and variants.
- Provided comprehensive OpenAPI schema metadata for new fields.
- Documented database migrations for the integration.
- Detailed configuration settings for Cloudflare Images.
- Updated API response formats to include Cloudflare Images URLs and variants.
- Added examples for uploading photos via API and outlined testing procedures.
2025-08-28 15:12:39 -04:00

83 lines
3.1 KiB
Python

"""
URL configuration for ThrillWiki API v1.
This module provides unified API routing following RESTful conventions
and DRF Router patterns for automatic URL generation.
"""
from .viewsets_rankings import RideRankingViewSet, TriggerRankingCalculationView
from .views import (
LoginAPIView,
SignupAPIView,
LogoutAPIView,
CurrentUserAPIView,
PasswordResetAPIView,
PasswordChangeAPIView,
SocialProvidersAPIView,
AuthStatusAPIView,
HealthCheckAPIView,
PerformanceMetricsAPIView,
SimpleHealthAPIView,
# Trending system views
TrendingAPIView,
NewContentAPIView,
)
from .views.stats import StatsAPIView, StatsRecalculateAPIView
from django.urls import path, include
from rest_framework.routers import DefaultRouter
# Create the main API router
router = DefaultRouter()
# Register ranking endpoints
router.register(r"rankings", RideRankingViewSet, basename="ranking")
app_name = "api_v1"
urlpatterns = [
# API Documentation endpoints are handled by main Django URLs
# See backend/thrillwiki/urls.py for documentation endpoints
# Authentication endpoints
path("auth/login/", LoginAPIView.as_view(), name="login"),
path("auth/signup/", SignupAPIView.as_view(), name="signup"),
path("auth/logout/", LogoutAPIView.as_view(), name="logout"),
path("auth/user/", CurrentUserAPIView.as_view(), name="current-user"),
path("auth/password/reset/", PasswordResetAPIView.as_view(), name="password-reset"),
path(
"auth/password/change/", PasswordChangeAPIView.as_view(), name="password-change"
),
path("auth/providers/", SocialProvidersAPIView.as_view(), name="social-providers"),
path("auth/status/", AuthStatusAPIView.as_view(), name="auth-status"),
# Health check endpoints
path("health/", HealthCheckAPIView.as_view(), name="health-check"),
path("health/simple/", SimpleHealthAPIView.as_view(), name="simple-health"),
path(
"health/performance/",
PerformanceMetricsAPIView.as_view(),
name="performance-metrics",
),
# Trending system endpoints
path("trending/content/", TrendingAPIView.as_view(), name="trending"),
path("trending/new/", NewContentAPIView.as_view(), name="new-content"),
# Statistics endpoints
path("stats/", StatsAPIView.as_view(), name="stats"),
path("stats/recalculate/", StatsRecalculateAPIView.as_view(), name="stats-recalculate"),
# Ranking system endpoints
path(
"rankings/calculate/",
TriggerRankingCalculationView.as_view(),
name="trigger-ranking-calculation",
),
# Domain-specific API endpoints
path("parks/", include("apps.api.v1.parks.urls")),
path("rides/", include("apps.api.v1.rides.urls")),
path("ride-models/", include("apps.api.v1.ride_models.urls")),
path("accounts/", include("apps.api.v1.accounts.urls")),
path("history/", include("apps.api.v1.history.urls")),
path("email/", include("apps.api.v1.email.urls")),
path("core/", include("apps.api.v1.core.urls")),
path("maps/", include("apps.api.v1.maps.urls")),
# Include router URLs (for rankings and any other router-registered endpoints)
path("", include(router.urls)),
]