28 lines
810 B
Python
28 lines
810 B
Python
#!/usr/bin/env python
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
# Change to project directory
|
|
os.chdir('/home/adebaumann/development/vgui-cicd')
|
|
|
|
# Clear Python cache
|
|
subprocess.run(['find', '.', '-name', '*.pyc', '-delete'], capture_output=True)
|
|
subprocess.run(['find', '.', '-name', '__pycache__', '-type', 'd', '-exec', 'rm', '-rf', '{}', '+'], capture_output=True)
|
|
|
|
# Set environment variable
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'VorgabenUI.settings'
|
|
|
|
# Test Django import
|
|
import django
|
|
from django.conf import settings
|
|
|
|
try:
|
|
django.setup()
|
|
print('✓ Django setup successful')
|
|
print('DATABASES:', settings.DATABASES)
|
|
print('BASE_DIR:', getattr(settings, 'BASE_DIR', 'NOT SET'))
|
|
except Exception as e:
|
|
print('✗ Django setup failed:', e)
|
|
import traceback
|
|
traceback.print_exc() |