Local Development Setup
If you want to modify the code or contribute to TriviaFlow, you should set up a local development environment.
Option A: Docker (Recommended)
The easiest way to develop is to use the existing Docker setup but override the settings for development.
-
Clone the repo:
git clone [https://github.com/your-user/triviaflow.git](https://github.com/your-user/triviaflow.git)
cd triviaflow -
Configure
.env: Copy.env.exampleto.envand set:DEBUG=True
# Use 'redis' if running via docker, or 'localhost' if running natively
REDIS_HOST=redis -
Run with Compose:
docker compose up --build
Benefits:
- The local folder is mounted into the container. Any change you make to
.pyfiles will trigger an auto-reload. - Database and Redis are pre-configured.
Option B: Native Python (Virtualenv)
If you prefer running Django directly on your machine.
Prerequisites
- Python 3.11+
- Redis Server (must be running locally)
- MariaDB or SQLite (Default is MariaDB, but you can switch to SQLite in settings.py for dev)
Steps
-
Create Virtual Environment:
python3 -m venv venv
source venv/bin/activate -
Install Dependencies:
pip install -r requirements.txt -
Set Environment Variables: Ensure your
.envconnects to your local Redis/DB, or modifysettings.pyto usesqlite3andInMemoryChannelLayerifUseDockeris False. -
Run Migrations:
python manage.py migrate -
Start Server:
python manage.py runserver