This commit includes: - Django backend with multi-tenancy (django-tenants) - React + TypeScript frontend with Vite - Platform administration API with role-based access control - Authentication system with token-based auth - Quick login dev tools for testing different user roles - CORS and CSRF configuration for local development - Docker development environment setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
|
|
import os
|
|
import django
|
|
from django.conf import settings
|
|
from django_tenants.utils import tenant_context
|
|
from core.models import Tenant
|
|
|
|
# Setup Django
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
|
django.setup()
|
|
|
|
from django.urls import resolve, reverse
|
|
|
|
print(f"ROOT_URLCONF: {settings.ROOT_URLCONF}")
|
|
|
|
try:
|
|
tenant = Tenant.objects.get(schema_name='demo')
|
|
print(f"Found tenant: {tenant}")
|
|
|
|
with tenant_context(tenant):
|
|
print(f"Active schema: {tenant.schema_name}")
|
|
try:
|
|
match = resolve('/api/resources/')
|
|
print(f"Resolved /api/resources/: {match}")
|
|
except Exception as e:
|
|
print(f"Failed to resolve /api/resources/: {e}")
|
|
|
|
try:
|
|
match = resolve('/api/schedule/resources/')
|
|
print(f"Resolved /api/schedule/resources/: {match}")
|
|
except Exception as e:
|
|
print(f"Failed to resolve /api/schedule/resources/: {e}")
|
|
|
|
except Tenant.DoesNotExist:
|
|
print("Demo tenant not found")
|