38086-vm/debug_url.py
2026-02-09 18:51:27 +00:00

23 lines
568 B
Python

import os
import django
from django.conf import settings
from django.urls import reverse, resolve
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
django.setup()
try:
print("Attempting to reverse 'inventory'...")
url = reverse('inventory')
print(f"Success: 'inventory' -> {url}")
except Exception as e:
print(f"Error reversing 'inventory': {e}")
try:
print("Attempting to reverse 'index'...")
url = reverse('index')
print(f"Success: 'index' -> {url}")
except Exception as e:
print(f"Error reversing 'index': {e}")