Technical Installation

This page describes the technical setup and deployment of the Martel Learning platform.

Stack Overview

  • Backend: Django 5.x (Python 3.12)
  • Database: PostgreSQL (production) or SQLite (development)
  • WSGI Server: Gunicorn
  • Process Manager: systemd
  • Reverse Proxy: Caddy (handles HTTPS, routing)
  • Frontend: Tailwind CSS, Crispy Forms

Environment Setup

Create a .env file in the project root or use /home/.env. Key variables:

  • USE_SQLITE=True — Use SQLite (development) or False for PostgreSQL
  • DB_NAME, DB_USER, DB_PASSWORD, DB_HOST — PostgreSQL credentials (when USE_SQLITE=False)
  • SECRET_KEY — Django secret key
  • ALLOWED_HOSTS — Comma-separated hostnames
  • TRANSLATION_BACKEND — google or nllb
  • TTS_BACKEND — google_cloud or gtts

Installation Steps

  1. Clone and prepare:
    cd /home/martel_learning
    source venv/bin/activate
    pip install -r requirements.txt
  2. Database:
    python manage.py migrate
    python manage.py createsuperuser
  3. Static files (Tailwind):
    cd theme && npm run build && cd ..
    python manage.py collectstatic --noinput
  4. Admin access: In Django admin, set UserProfile role to "instructor" or "admin" for dashboard access.

Production Deployment

The application runs as a systemd service (martel-learning.service) using Gunicorn.

  • Service file: /etc/systemd/system/martel-learning.service
  • Gunicorn config: gunicorn.conf.py (bind 0.0.0.0:8000, 1 worker, preload)
  • Restart: sudo systemctl restart martel-learning
  • Logs: journalctl -u martel-learning -f or /home/martel_learning/logs/gunicorn_error.log

Optional Services

For YouTube workflow features (OCR, translation, TTS):

  • DeepSeek-OCR-2: Remote API for OCR (default: http://192.168.1.109:23456, model: deepseek-ocr-2). For Cyrillic, use Tesseract backend if the API returns transliteration; install tesseract-ocr-rus.
  • NLLB Translation: For TRANSLATION_BACKEND=nllb (default: http://192.168.1.109:23457)
  • Google Cloud: Translation API key and TTS credentials when using Google services

URLs

  • Landing: /
  • Courses: /courses/
  • Login: /accounts/login/
  • Admin Dashboard: /admin-dashboard/
  • Django Admin: /admin/