Prerequisites
Before you begin, make sure you have the following installed:- Python 3.11+ — verify with
python3 --version - pip — included with Python 3.11+
- Git — to clone the repository
- mysqlclient system dependencies (for MySQL in production) — on Debian/Ubuntu:
sudo apt-get install default-libmysqlclient-dev
Setup steps
Create a virtual environment
Create and activate an isolated Python environment:Your terminal prompt will change to show
- macOS / Linux
- Windows
(.venv) when the environment is active.Install dependencies
Install all required packages from This installs the following key packages:
requirements.txt:| Package | Version | Purpose |
|---|---|---|
| Django | 5.2.3 | Web framework |
| djangorestframework | 3.16.0 | REST API |
| djangorestframework-simplejwt | 5.5.0 | JWT authentication |
| django-cors-headers | 4.7.0 | CORS management |
| mysqlclient | 2.2.7 | MySQL driver (production) |
| Pillow | 11.2.1 | Image processing |
| qrcode | 8.2 | QR code generation |
| python-dotenv | 0.19.2 | Environment variables |
| openpyxl | 3.1.2 | Excel export |
Configure environment variables
The project reads configuration from See the Environment variables page for a full reference of all available variables.
config/.env. A default file is already provided for development. Review and update it as needed:config/.env
Run database migrations
Apply all database migrations to create the schema:Django will create
db.sqlite3 in the backend/ directory with all required tables.Create a superuser
Create an admin account to access the Django admin panel at You will be prompted for a username, email address, and password.
/admin/:Seed system roles
The project includes a script that creates the Expected output:
admin and cliente role groups and assigns the appropriate model-level permissions to each:This script must be run after migrations and after creating a superuser. It is idempotent — running it again will not duplicate roles.
Database configuration
The project supports two database backends.SQLite (development)
The default configuration uses SQLite — no additional setup is required:config/.env
MySQL (production)
To switch to MySQL, updateconfig/.env and uncomment the MySQL block in config/settings.py:
config/.env
mysqlclient package is already included in requirements.txt and handles the connection.
Useful management commands
Media file storage
Uploaded files are stored locally undermedia/ during development:
config/supabase_storage.py). See the SUPABASE_STORAGE_README.md file in the backend directory for configuration instructions.
Troubleshooting
Migration errors
Migration errors
If you encounter migration conflicts, you can reset the API migrations. This deletes all data in the database.
Dependency errors
Dependency errors
If a package fails to install or causes a conflict, reinstall all dependencies cleanly:
Media folder permission errors
Media folder permission errors
On Unix systems, ensure the
media/ directory is writable by the process running the server:mysqlclient build failure
mysqlclient build failure
On Debian/Ubuntu, install the MySQL development headers before running On macOS with Homebrew:
pip install: