Files
vgui-cicd/test_django_setup.py

31 lines
921 B
Python

#!/usr/bin/env python
"""Test Django settings loading"""
import os
import sys
import django
from django.conf import settings
# Set the settings module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VorgabenUI.settings')
print("=== Before Django setup ===")
print(f"Settings module: {os.environ.get('DJANGO_SETTINGS_MODULE')}")
try:
print("Calling django.setup()...")
django.setup()
print("Django setup completed successfully")
print("=== After Django setup ===")
print(f"Settings configured: {settings.configured}")
print(f"Available attributes: {[attr for attr in dir(settings) if not attr.startswith('_')]}")
if hasattr(settings, 'DATABASES'):
print(f"DATABASES: {settings.DATABASES}")
else:
print("DATABASES not found in settings")
except Exception as e:
print(f"Error during Django setup: {e}")
import traceback
traceback.print_exc()