# Production Environment Configuration for GNX-WEB # Copy this file to .env in the backEnd directory and update with your actual values # Backend runs on port 1086 (internal only, proxied through nginx) # Django Settings SECRET_KEY=your-super-secret-production-key-here-change-this-immediately DEBUG=False ALLOWED_HOSTS=gnxsoft.com,www.gnxsoft.com,your-server-ip,localhost,127.0.0.1 # Database - PostgreSQL on host (port 5433 to avoid conflict with Docker instance on 5432) # Format: postgresql://USER:PASSWORD@HOST:PORT/DBNAME # Create database: sudo -u postgres psql # CREATE DATABASE gnx_db; # CREATE USER gnx_user WITH PASSWORD 'your_secure_password'; # GRANT ALL PRIVILEGES ON DATABASE gnx_db TO gnx_user; DATABASE_URL=postgresql://gnx_user:your_password_here@localhost:5433/gnx_db # Email Configuration (Production) EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend EMAIL_HOST=mail.gnxsoft.com EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_USE_SSL=False EMAIL_HOST_USER=your-email@gnxsoft.com EMAIL_HOST_PASSWORD=your-email-password DEFAULT_FROM_EMAIL=noreply@gnxsoft.com # Company email for contact form notifications COMPANY_EMAIL=contact@gnxsoft.com SUPPORT_EMAIL=support@gnxsoft.com # Email timeout settings for production reliability EMAIL_TIMEOUT=30 EMAIL_CONNECTION_TIMEOUT=10 EMAIL_READ_TIMEOUT=10 # Security Settings SECURE_SSL_REDIRECT=True SECURE_HSTS_SECONDS=31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS=True SECURE_HSTS_PRELOAD=True SECURE_CONTENT_TYPE_NOSNIFF=True SECURE_BROWSER_XSS_FILTER=True X_FRAME_OPTIONS=DENY SESSION_COOKIE_SECURE=True CSRF_COOKIE_SECURE=True # CORS Settings (Production) PRODUCTION_ORIGINS=https://gnxsoft.com,https://www.gnxsoft.com CORS_ALLOW_CREDENTIALS=True # CSRF Trusted Origins CSRF_TRUSTED_ORIGINS=https://gnxsoft.com,https://www.gnxsoft.com # API Security - Internal API Key (nginx will add this header) # REQUIRED in production! Auto-generated only in DEBUG mode. # Generate a secure key: python -c "import secrets; print(secrets.token_urlsafe(32))" # Or get current key: python manage.py show_api_key # This key must match the one in nginx configuration INTERNAL_API_KEY=your-secure-api-key-here-change-this-in-production # Admin IP Restriction - Only these IPs can access Django admin # Comma-separated list of IP addresses or CIDR networks (e.g., 193.194.155.249 or 192.168.1.0/24) ADMIN_ALLOWED_IPS=193.194.155.249 # Custom allowed IPs for IP whitelist middleware (optional, comma-separated) CUSTOM_ALLOWED_IPS= # Site URL for email links and absolute URLs SITE_URL=https://gnxsoft.com # Static and Media Files (relative to backEnd directory) # These will be collected/served from these locations STATIC_ROOT=/home/gnx/Desktop/GNX-WEB/backEnd/staticfiles MEDIA_ROOT=/home/gnx/Desktop/GNX-WEB/backEnd/media # Logging LOG_LEVEL=INFO # Backend Port (internal only, nginx proxies to this) # Backend runs on 127.0.0.1:1086 BACKEND_PORT=1086