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) orFalsefor PostgreSQLDB_NAME,DB_USER,DB_PASSWORD,DB_HOST— PostgreSQL credentials (whenUSE_SQLITE=False)SECRET_KEY— Django secret keyALLOWED_HOSTS— Comma-separated hostnamesTRANSLATION_BACKEND—googleornllbTTS_BACKEND—google_cloudorgtts
Installation Steps
-
Clone and prepare:
cd /home/martel_learning source venv/bin/activate pip install -r requirements.txt -
Database:
python manage.py migrate python manage.py createsuperuser -
Static files (Tailwind):
cd theme && npm run build && cd .. python manage.py collectstatic --noinput - 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 -for/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; installtesseract-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/