Skip to content
docisit edited this page Jul 27, 2026 · 2 revisions

🔧 Admin Panel

Django Admin — the super-user backend for full control over ITG Media App's data, users, and configuration.


Overview

The Django Admin panel is the true super-user backend for ITG Media App. While most day-to-day management happens through the frontend dashboard, the admin panel provides full access to every model, user, and setting in the database.

Access it at your configured admin URL (default: /admin/).


🔒 Security First

⚠️ Critical: The Django Admin panel is powerful — it gives full database access. Secure it properly before going to production.

Change the Admin URL

The default /admin/ path is targeted by bots and attackers. Change it:

# .env
ADMIN_URL=my-secure-panel/

Pick something hard to guess — avoid admin, backend, panel, dashboard.

IP Whitelist

Restrict access to trusted IP addresses only:

# .env
ADMIN_IP_WHITELIST=203.0.113.1,203.0.113.2
  • Only requests from these IPs can access the admin
  • Use your office IP, VPN IP, or static home IP
  • Leave blank to disable IP checking (not recommended)
  • Multiple IPs are comma-separated

Additional Security

Measure Recommendation
Strong Password Use a 20+ character random password for admin accounts
2FA Consider adding Django OTP or similar two-factor authentication
HTTPS Only Always serve admin over HTTPS — never over plain HTTP
Limited Admin Users Only create admin accounts for people who actually need them
Audit Logging Monitor admin login attempts and actions

🗂️ Admin Models

ITG Media App registers these models in the Django Admin:

Core Models

Model Purpose
Users Django's built-in user management
Profiles User profiles with roles, bio, social links
Shows Scheduled shows with guest assignments
Guest Requests Guest join requests with approval workflow
Blog Posts Blog articles with categories and featured flag
Blog Comments User comments on blog posts
Media Assets Uploaded images, videos, with tags
Contact Inquiries Messages from the contact form

Chat Models

Model Purpose
AI Personalities Define chatbot personality, tone, and behavior
AI Chat Sessions User chat sessions with conversation history
AI Chat Messages Individual messages within chat sessions
Site Chat Config Chat widget settings (business hours, rate limits)
Site Chat FAQs Pre-written FAQ responses

Streaming Models

Model Purpose
Streaming Platforms Connected social platforms (YouTube, Facebook, TikTok)
Streaming Sessions Active and past streaming sessions
WebRTC Rooms LiveKit room configurations
WebRTC Participants Participant records in WebRTC rooms
WebRTC Signals Signaling events log

Avatar Models

Model Purpose
Avatar Configs Avatar agent appearance and behavior settings
Guest Conversations Pre-show guest conversation records

Sports Module (If Enabled)

Model Purpose
Sports Available sports with attributes
Athlete Stat Entries Recorded stats with history
Stat Verification Videos Video proof for stat verification
Drills Drill library entries
Media Tags Key-value tags on media assets

👥 Managing Users

Creating an Admin User

python manage.py createsuperuser

Follow the prompts to set username, email, and password.

Changing User Roles

  1. Navigate to Members → Profiles
  2. Find the user and click to edit
  3. Change the Role dropdown (host, guest, athlete, staff, admin)
  4. Click Save

Resetting a User Password

  1. Navigate to Authentication and Authorization → Users
  2. Find the user
  3. Click on the user, then use the password change form
  4. Or use the command line:
    python manage.py changepassword <username>

Bulk Operations

The Django Admin supports bulk actions on most models:

  • Select multiple rows using checkboxes
  • Choose an action from the dropdown (delete, update role, etc.)
  • Click Go

📊 Common Admin Tasks

Approving Guest Requests

  1. Navigate to Members → Guest Requests
  2. Filter by status (Pending)
  3. Review the request details
  4. Click Approve or Reject
  5. Approved guests receive an email with their join link

Managing Shows

  1. Navigate to Members → Shows
  2. Add, edit, or delete shows
  3. Assign guests to shows
  4. Set show date, time, and status
  5. Upload show cover images

Managing Blog Posts

  1. Navigate to Members → Blog Posts
  2. Create new posts with rich text content
  3. Set categories, tags, and featured status
  4. Schedule publish dates
  5. Moderate comments

Managing FAQs (Site Chat)

  1. Navigate to Members → Site Chat FAQs
  2. Add new FAQ entries with question/answer pairs
  3. Set priority (higher checked first)
  4. Assign categories for organization
  5. FAQs are matched directly — no LLM call needed for a match

Clearing Chat Sessions

  1. Navigate to Members → AI Chat Sessions
  2. Select old or unwanted sessions
  3. Use bulk delete action
  4. This frees database space and respects user privacy

🎨 Admin Interface Tips

Search

Most admin list views include a search bar at the top. Search by:

  • Username or email (Users/Profiles)
  • Show title (Shows)
  • Blog title (Blog Posts)
  • Guest name (Guest Requests)

Filters

Right sidebar filters help narrow down lists:

  • Filter by role (Profiles)
  • Filter by status (Guest Requests, Shows)
  • Filter by date (Blog Posts, Shows)
  • Filter by category (Blog Posts)

List Display

Customize which columns appear by clicking the column headers. Most lists support sorting.

Inline Editing

Some models (like Profiles) include inline editing for related models — you can edit blog comments directly on the blog post page, or edit drill details inline.


🖥️ Collecting Static Files

The admin interface requires CSS and JavaScript files. After deploying, always run:

python manage.py collectstatic --noinput

This collects Django Admin static files into your STATIC_ROOT directory. If the admin looks unstyled (no CSS), you forgot this step.


🔄 After Deployment Checklist

  • Changed ADMIN_URL from the default admin/
  • Set ADMIN_IP_WHITELIST to your IP(s)
  • Created admin user with strong password
  • DEBUG=False in production
  • Admin is only accessible over HTTPS
  • Ran python manage.py collectstatic --noinput
  • Tested admin access from a whitelisted IP
  • Verified admin is blocked from non-whitelisted IPs

⏭️ Next Steps


← Back to Wiki Home

Clone this wiki locally