Help update from the error panel

Help update from the error panel, how can I fix it?

Error
Error: Reverse for ‘aiScannerHome’ not found. ‘aiScannerHome’ is not a valid view function or pattern name.

One-Time Fix

Since the aiScanner tables are already being created manually in upgrade.py, the issue is likely that the aiScanner app files are missing. Here’s
the safe fix:

Solution 1: Create a Dummy View (Quick Fix)

Create a minimal aiScanner setup to satisfy the URL resolver:

  1. Create the aiScanner directory if missing:
    mkdir -p /usr/local/CyberCP/aiScanner

  2. Create a minimal views.py:
    cat > /usr/local/CyberCP/aiScanner/views.py << ‘EOF’
    from django.shortcuts import render, redirect
    from django.http import HttpResponse

def aiScannerHome(request):
# Redirect to home page or show a message
return redirect(‘/’)
# Or return a simple message:
# return HttpResponse(“AI Scanner module is being updated. Please check back later.”)
EOF

  1. Create urls.py:
    cat > /usr/local/CyberCP/aiScanner/urls.py << ‘EOF’
    from django.urls import path
    from . import views

urlpatterns = [
path(‘’, views.aiScannerHome, name=‘aiScannerHome’),
]
EOF

  1. Create init.py to make it a Python package:
    touch /usr/local/CyberCP/aiScanner/init.py

  2. Fix permissions:
    chown -R cyberpanel:cyberpanel /usr/local/CyberCP/aiScanner/

  3. Restart CyberPanel:
    systemctl restart lscpd

Solution 2: Manually Download Only aiScanner Files (Safest)

If they want the full aiScanner functionality without affecting other files:

Download only the aiScanner directory from GitHub

cd /tmp
wget https://github.com/usmannasir/cyberpanel/archive/refs/heads/stable.zip
unzip stable.zip
cp -r cyberpanel-stable/aiScanner /usr/local/CyberCP/
rm -rf stable.zip cyberpanel-stable

Fix permissions

chown -R cyberpanel:cyberpanel /usr/local/CyberCP/aiScanner/

Restart

systemctl restart lscpd

Root Cause:

During the upgrade from an older version, the aiScanner app directory wasn’t copied to the installation, but it was added to INSTALLED_APPS and
the URLs. This creates a mismatch where Django expects the app to exist but can’t find it.