Files
vgui-cicd/test_current_settings.py

33 lines
973 B
Python

#!/usr/bin/env python
"""Test current settings file directly"""
import os
import sys
from pathlib import Path
# Set up environment like Django would
BASE_DIR = Path('.').resolve()
# Read and execute the settings file with proper context
settings_globals = {
'__name__': 'VorgabenUI.settings',
'__file__': 'VorgabenUI/settings.py',
'__package__': 'VorgabenUI',
'os': os,
'Path': Path,
'BASE_DIR': BASE_DIR,
}
with open('VorgabenUI/settings.py', 'r') as f:
settings_code = f.read()
print('=== Executing current settings file ===')
try:
exec(settings_code, settings_globals)
print('Settings executed successfully')
print('DATABASES:', settings_globals.get('DATABASES', 'NOT FOUND'))
print('SECRET_KEY:', settings_globals.get('SECRET_KEY', 'NOT FOUND'))
print('DEBUG:', settings_globals.get('DEBUG', 'NOT FOUND'))
except Exception as e:
print('Error executing settings:', e)
import traceback
traceback.print_exc()