Files
thrillwiki_django_no_react/backend/setup_social_providers.py
pacnpal c2c26cfd1d Add comprehensive API documentation for ThrillWiki integration and features
- Introduced Next.js integration guide for ThrillWiki API, detailing authentication, core domain APIs, data structures, and implementation patterns.
- Documented the migration to Rich Choice Objects, highlighting changes for frontend developers and enhanced metadata availability.
- Fixed the missing `get_by_slug` method in the Ride model, ensuring proper functionality of ride detail endpoints.
- Created a test script to verify manufacturer syncing with ride models, ensuring data integrity across related models.
2025-09-16 11:29:17 -04:00

46 lines
1.3 KiB
Python

#!/usr/bin/env python
"""
Script to set up social authentication providers for development.
Run this with: uv run manage.py shell < setup_social_providers.py
"""
from allauth.socialaccount.models import SocialApp
from django.contrib.sites.models import Site
# Get the current site
site = Site.objects.get_current()
print(f"Setting up social providers for site: {site}")
# Clear existing social apps to avoid duplicates
SocialApp.objects.all().delete()
print("Cleared existing social apps")
# Create Google social app
google_app = SocialApp.objects.create(
provider="google",
name="Google",
client_id="demo-google-client-id.apps.googleusercontent.com",
secret="demo-google-client-secret",
key="", # Not used for Google
)
google_app.sites.add(site)
print("✅ Created Google social app")
# Create Discord social app
discord_app = SocialApp.objects.create(
provider="discord",
name="Discord",
client_id="demo-discord-client-id",
secret="demo-discord-client-secret",
key="", # Not used for Discord
)
discord_app.sites.add(site)
print("✅ Created Discord social app")
# List all social apps
print("\nConfigured social apps:")
for app in SocialApp.objects.all():
print(f"- {app.name} ({app.provider}): {app.client_id}")
print(f"\nTotal social apps: {SocialApp.objects.count()}")