Refactor API structure and add comprehensive user management features

- Restructure API v1 with improved serializers organization
- Add user deletion requests and moderation queue system
- Implement bulk moderation operations and permissions
- Add user profile enhancements with display names and avatars
- Expand ride and park API endpoints with better filtering
- Add manufacturer API with detailed ride relationships
- Improve authentication flows and error handling
- Update frontend documentation and API specifications
This commit is contained in:
pacnpal
2025-08-29 16:03:51 -04:00
parent 7b9f64be72
commit bb7da85516
92 changed files with 19690 additions and 9076 deletions

View File

@@ -12,58 +12,52 @@ import os
from celery import Celery
# Set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.django.local')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.django.local")
app = Celery('thrillwiki')
app = Celery("thrillwiki")
# Get Redis URL from environment variable with fallback
REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/1')
REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/1")
# Celery Configuration - set directly without loading from Django settings first
app.conf.update(
# Broker settings
broker_url=REDIS_URL,
result_backend=REDIS_URL,
# Task settings
task_serializer='json',
accept_content=['json'],
result_serializer='json',
timezone='America/New_York',
task_serializer="json",
accept_content=["json"],
result_serializer="json",
timezone="America/New_York",
enable_utc=True,
# Worker settings
worker_prefetch_multiplier=1,
task_acks_late=True,
worker_max_tasks_per_child=1000,
# Task routing
task_routes={
'apps.core.tasks.trending.*': {'queue': 'trending'},
'apps.core.tasks.analytics.*': {'queue': 'analytics'},
'apps.core.tasks.cache.*': {'queue': 'cache'},
"apps.core.tasks.trending.*": {"queue": "trending"},
"apps.core.tasks.analytics.*": {"queue": "analytics"},
"apps.core.tasks.cache.*": {"queue": "cache"},
},
# Beat schedule for periodic tasks
beat_schedule={
'calculate-trending-content': {
'task': 'apps.core.tasks.trending.calculate_trending_content',
'schedule': 300.0, # Every 5 minutes
"calculate-trending-content": {
"task": "apps.core.tasks.trending.calculate_trending_content",
"schedule": 300.0, # Every 5 minutes
},
'warm-trending-cache': {
'task': 'apps.core.tasks.trending.warm_trending_cache',
'schedule': 900.0, # Every 15 minutes
"warm-trending-cache": {
"task": "apps.core.tasks.trending.warm_trending_cache",
"schedule": 900.0, # Every 15 minutes
},
'cleanup-old-analytics': {
'task': 'apps.core.tasks.analytics.cleanup_old_analytics',
'schedule': 86400.0, # Daily
"cleanup-old-analytics": {
"task": "apps.core.tasks.analytics.cleanup_old_analytics",
"schedule": 86400.0, # Daily
},
},
# Task result settings
result_expires=3600, # 1 hour
task_ignore_result=False,
# Error handling
task_reject_on_worker_lost=True,
task_soft_time_limit=300, # 5 minutes
@@ -77,4 +71,4 @@ app.autodiscover_tasks()
@app.task(bind=True)
def debug_task(self):
"""Debug task for testing Celery setup."""
print(f'Request: {self.request!r}')
print(f"Request: {self.request!r}")