Files
thrillwiki_django_no_react/backend/setup_social_providers.py
pacnpal e62646bcf9 feat: major API restructure and Vue.js frontend integration
- Centralize API endpoints in dedicated api app with v1 versioning
- Remove individual API modules from parks and rides apps
- Add event tracking system with analytics functionality
- Integrate Vue.js frontend with Tailwind CSS v4 and TypeScript
- Add comprehensive database migrations for event tracking
- Implement user authentication and social provider setup
- Add API schema documentation and serializers
- Configure development environment with shared scripts
- Update project structure for monorepo with frontend/backend separation
2025-08-24 16:42:20 -04:00

46 lines
1.3 KiB
Python

#!/usr/bin/env python
"""
Script to set up social authentication providers for development.
Run this with: python 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()}")