API — Installation
Local development setup for the Django API. Matches the repo README, written for this docs site.
Requirements
- Docker (MySQL container)
- Python 3.14 (latest)
- Optional DB GUI: DBeaver, phpMyAdmin, MySQL Workbench, TablePlus, etc.
See Environments for default port 8000.
1. Install Docker
Ubuntu (apt)
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl enable --now docker
Allow your user to run Docker without sudo (log out and back in afterward):
sudo usermod -aG docker $USER
docker --version
Windows (WSL + Docker Desktop)
- In PowerShell as Administrator, install WSL 2:
powershell
wsl --install
- Install Docker Desktop for Windows. Keep the WSL 2 engine enabled.
2. Run MySQL
docker pull mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=<PASS> -p 3306:3306 -d mysql
docker ps
Keep the root password; you will reuse it in local_settings.py.
3. Database GUI (optional)
DBeaver — connect to:
| Field | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 3306 |
| User | root |
| Password | the MYSQL_ROOT_PASSWORD from the previous step |
4. Create the database
docker exec -it mysql mysql -uroot -p -e "CREATE DATABASE \`resa_database\` COLLATE 'utf8_general_ci';"
CREATE DATABASE `resa_database` COLLATE 'utf8_general_ci';
The name must match NAME in config/local_settings.py.
5. Create config/local_settings.py
This file is gitignored. Django loads it for local development (see Configuration).
DEBUG = True
SECRET_KEY = "replace-with-a-long-random-string"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "resa_database",
"USER": "root",
"PASSWORD": "yourpassword",
"HOST": "127.0.0.1",
"PORT": "3306",
}
}
Use a long random SECRET_KEY (not a production key). PASSWORD must match the MySQL root password.
Warning — do not commit secrets
Never commitconfig/local_settings.pyor real.envfiles. Keep them local only.
6. Install Python
Download Python 3.14 from python.org/downloads.
On Windows, check “Add python.exe to PATH”.
On Ubuntu / WSL, install MySQL client headers for mysqlclient:
sudo apt-get update
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential pkg-config
python --version
7. Create a virtual environment
From the api project directory:
python -m venv venv
8. Activate the virtual environment
Windows (PowerShell):
.\venv\Scripts\Activate.ps1
Windows (CMD):
venv\Scripts\activate
macOS / Linux / WSL:
source venv/bin/activate
When active, your prompt shows a (venv) prefix.
9. Upgrade pip tooling
pip install --upgrade pip setuptools wheel
10. Install requirements
pip install -r requirements.txt
11. Migrations
python manage.py makemigrations
python manage.py migrate
12. Superuser and runserver
python manage.py createsuperuser
python manage.py runserver
Open http://127.0.0.1:8000. Django reloads when you save Python files.
Point Staff/Customer VITE_API_BASE_URL at this origin when developing against your local API.
Next
- Configuration — env vars, CORS, settings load order
- Applications — per-app docs (TBD)
- Overview