import os
import django
from django.urls import reverse
from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
django.setup()

links = [
    "admin:shop_wechatuser_changelist",
    "admin:shop_salesperson_changelist",
    "admin:shop_distributor_changelist",
    "admin:shop_esp32config_changelist",
    "admin:shop_service_changelist",
    "admin:shop_VBcourse_changelist",
    "admin:shop_order_changelist",
    "admin:shop_serviceorder_changelist",
    "admin:shop_withdrawal_changelist",
    "admin:shop_commissionlog_changelist",
    "admin:shop_wechatpayconfig_changelist",
    "admin:auth_user_changelist",
]

print("Checking URL patterns...")
for link in links:
    try:
        url = reverse(link)
        print(f"[OK] {link} -> {url}")
    except Exception as e:
        print(f"[ERROR] {link}: {e}")
