-
Notifications
You must be signed in to change notification settings - Fork 0
configuration
Complete reference for all environment variables and feature flags in ITG Media App.
# Copy the example file
cp .env.example .env
# Edit with your settings
nano .envAll configuration is driven by environment variables in the .env file (backend) and .env.local or .env.production (frontend).
These must be set for ITG Media App to function:
| Variable | Description |
|---|---|
SECRET_KEY |
Django secret key — generate a unique random value |
ALLOWED_HOSTS |
Comma-separated list of domain names the site will serve (e.g., yourdomain.com,localhost) |
DATABASE_URL |
PostgreSQL connection string. Leave blank to use SQLite for local dev |
REDIS_URL |
Redis connection (e.g., redis://127.0.0.1:6379/0). Required for WebSockets and LiveKit |
LIVEKIT_API_KEY |
LiveKit API key — from cloud.livekit.io or your self-hosted server |
LIVEKIT_API_SECRET |
LiveKit API secret |
LIVEKIT_URL |
LiveKit WebSocket URL (e.g., wss://vdo.yourdomain.com) |
FRONTEND_URL |
Frontend URL for CORS, email links, redirects (e.g., https://yourdomain.com) |
INTERNAL_API_SECRET |
Random hex string for internal API calls (agent ↔ backend communication) |
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"openssl rand -hex 32| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
(empty → SQLite) | PostgreSQL connection. If blank, uses SQLite (not for production!) |
| Variable | Default | Description |
|---|---|---|
LIVEKIT_API_URL |
http://localhost:7880 |
HTTP API URL — Django calls this for room management. Set to your LiveKit server's API endpoint |
| Variable | Default | Description |
|---|---|---|
DEBUG |
True |
Never enable in production! Controls error pages and static file handling |
DJANGO_ENV |
development |
development or production
|
| Variable | Default | Description |
|---|---|---|
ADMIN_URL |
admin/ |
Change the admin URL path to hide it from bots (e.g., my-secret-admin/) |
ADMIN_IP_WHITELIST |
127.0.0.1 |
Comma-separated IPs allowed to access /admin/. Leave empty to disable IP check |
⚠️ Security Tip: Always changeADMIN_URLfrom the defaultadmin/and setADMIN_IP_WHITELISTto your static IP before going to production.
| Variable | Default | Description |
|---|---|---|
EMAIL_HOST |
localhost |
SMTP server hostname |
EMAIL_PORT |
1025 |
SMTP port |
EMAIL_USE_TLS |
False |
Enable TLS for SMTP |
EMAIL_HOST_USER |
(empty) | SMTP username |
EMAIL_HOST_PASSWORD |
(empty) | SMTP password |
DEFAULT_FROM_EMAIL |
noreply@yourdomain.com |
From address for system emails |
For development, emails are printed to the console by default. Set up a real SMTP server (SendGrid, Mailgun, AWS SES) for production.
| Variable | Default | Description |
|---|---|---|
RTMP_SERVER_URL |
rtmp://localhost:1935 |
RTMP server for stream relay |
RTMP_INGEST_APPLICATION |
ingest |
RTMP ingest application name |
RTMP_LIVE_APPLICATION |
live |
RTMP live application name |
RTMP_GUEST_STREAM_PREFIX |
guest_ |
Prefix for guest RTMP streams |
RTMP_OBS_STREAM_NAME |
obs |
OBS RTMP stream name |
RTMP_COMPOSED_STREAM_NAME |
composed |
Composed output stream name |
| Variable | Default | Description |
|---|---|---|
YOUTUBE_RTMP_URL |
(empty) | YouTube RTMP ingest URL |
FACEBOOK_RTMP_URL |
(empty) | Facebook RTMP ingest URL |
TIKTOK_RTMP_URL |
(empty) | TikTok RTMP ingest URL |
| Variable | Default | Description |
|---|---|---|
TURNSTILE_SITE_KEY |
(empty) | Cloudflare Turnstile site key (leave blank to disable) |
TURNSTILE_SECRET_KEY |
(empty) | Cloudflare Turnstile secret key |
Get keys at Cloudflare Turnstile Dashboard.
| Variable | Default | Description |
|---|---|---|
NEXTAUTH_URL |
http://localhost:3000 |
Frontend base URL |
NEXTAUTH_SECRET |
(to be generated) | NextAuth.js JWT signing secret |
Feature flags allow you to enable/disable optional modules without modifying code.
| Flag | Default | What it Controls |
|---|---|---|
SPORTS_MODULE_ENABLED |
False |
Athlete stats, drills, scouting, leaderboards, verifications |
STREAMING_PLATFORMS_ENABLED |
True |
Multi-platform streaming (YouTube, Facebook, etc.) |
STREAMING_MULTICAST_ENABLED |
True |
Multicast streaming support |
STREAMING_OWNCAST_ENABLED |
False |
Owncast as streaming destination |
FFMPEG_COMPOSITION_ENABLED |
True |
FFmpeg video composition for portrait/overlay layouts |
Flags are set in .env:
# Enable the Sports Module
SPORTS_MODULE_ENABLED=TrueWhen a flag is off, the Django backend:
- Skips registering URL patterns for that feature
- Hides admin model registrations
- Excludes extra serializer fields
- But keeps models in the database (no migration complexity)
💡 Models are always in the database regardless of flag state. The flags only control API exposure and UI visibility.
When True, these features become available:
| Feature | Details |
|---|---|
| Sports Management | List/create sports with recruiter attributes |
| Athlete Stats | Record stats with history, trend data |
| Leaderboards | Per-stat leaderboards across all athletes |
| Drills | Drill library (CRUD) |
| Verifications | Video proof for stat verification |
| Extra Profile Fields | Height, weight, 40-yard time, vertical jump, GPA, etc. |
| Coach Verification | Verified coach badges, years of experience, certifications |
The Next.js frontend reads from frontend/.env.local (dev) or frontend/.env.production (prod):
# frontend/.env.local
NEXT_PUBLIC_API_URL=https://api.yourdomain.com
NEXT_PUBLIC_LIVEKIT_URL=wss://vdo.yourdomain.com
NEXT_PUBLIC_SITE_URL=https://yourdomain.comHere's a fully-commented production example:
# ===========================================================
# .env — ITG Media App Production Configuration
# ===========================================================
# ---- Django ----
DJANGO_ENV=production
SECRET_KEY=django-insecure-<your-generated-64-char-key>
DEBUG=False
ALLOWED_HOSTS=donoconnor.com,www.donoconnor.com,localhost
# ---- Database ----
DATABASE_URL=postgres://media_user:strongpassword@localhost:5432/media_db
# ---- Redis ----
REDIS_URL=redis://127.0.0.1:6379/0
REDIS_PASSWORD=
# ---- LiveKit ----
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LIVEKIT_URL=wss://vdo.donoconnor.com
LIVEKIT_API_URL=https://vdo.donoconnor.com
# ---- Internal Security ----
INTERNAL_API_SECRET=<openssl-rand-hex-32-output>
# ---- Admin ----
ADMIN_URL=secure-panel/
ADMIN_IP_WHITELIST=203.0.113.1,203.0.113.2
# ---- Frontend URLs ----
FRONTEND_URL=https://donoconnor.com
# ---- Email (SendGrid / Mailgun / AWS SES) ----
EMAIL_HOST=smtp.sendgrid.net
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=apikey
EMAIL_HOST_PASSWORD=SG.xxxxxxxxxxxxxxxxxxxx
DEFAULT_FROM_EMAIL=noreply@donoconnor.com
# ---- RTMP ----
RTMP_SERVER_URL=rtmp://localhost:1935
# ---- Social Streaming ----
YOUTUBE_RTMP_URL=rtmp://a.rtmp.youtube.com/live2
FACEBOOK_RTMP_URL=rtmp://live-api-s.facebook.com:80/rtmp
TIKTOK_RTMP_URL=rtmp://live.tiktok.com/live
# ---- Feature Flags ----
SPORTS_MODULE_ENABLED=True
STREAMING_PLATFORMS_ENABLED=True
STREAMING_MULTICAST_ENABLED=True
FFMPEG_COMPOSITION_ENABLED=True
# ---- Turnstile ----
TURNSTILE_SITE_KEY=0x4AAAAAAxxxxxxxxxxxx
TURNSTILE_SECRET_KEY=0x4AAAAAAxxxxxxxxxxxxxxxxxxxxxxxx
# ---- NextAuth.js ----
NEXTAUTH_URL=https://donoconnor.com
NEXTAUTH_SECRET=<another-random-secret-here>-
SECRET_KEYis set and unique -
DEBUG=Falsein production -
ALLOWED_HOSTSincludes your production domain -
DATABASE_URLpoints to your PostgreSQL instance -
REDIS_URLis configured and Redis is running - All LiveKit variables are set with valid keys
-
FRONTEND_URLmatches your actual domain -
ADMIN_URLhas been changed from the defaultadmin/ -
ADMIN_IP_WHITELISTis set to your IP address(es) - Email settings are configured for production (not console backend)
- Social RTMP keys are filled in if using simulcast
- Feature flags are set to your preferred configuration
- LiveKit Setup — Get WebRTC infrastructure running
- Deployment — Set up Nginx, SSL, and go live
← Back to Wiki Home