Files
smoothschedule/smoothschedule/debug_urls.py
poduck 156cc2676d refactor: Reorganize Django apps into domain-based structure
Restructured 13 Django apps from flat/mixed organization into 5 logical
domain packages following cookiecutter-django conventions:

- identity/: core (tenant/domain models, middleware, mixins), users
- scheduling/: schedule, contracts, analytics
- communication/: notifications, credits, mobile, messaging
- commerce/: payments, tickets
- platform/: admin, api

Key changes:
- Moved all apps to smoothschedule/smoothschedule/{domain}/{app}/
- Updated all import paths across the codebase
- Updated settings (base.py, multitenancy.py, test.py)
- Updated URL configuration in config/urls.py
- Updated middleware and permission paths
- Preserved app_label in AppConfig for migration compatibility
- Updated CLAUDE.md documentation with new structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:24:50 -05:00

36 lines
1.0 KiB
Python

import os
import django
from django.conf import settings
from django_tenants.utils import tenant_context
from smoothschedule.identity.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")