Dev

Setup a DEV environment with UV

# install UV package python package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
vi ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrc
uv --version
uvx --version


# install prerequisite packages to build various python drivers
# Debian
apt install libmysqlclient-dev pkg-config python3-dev default-libmysqlclient-dev build-essential gettext


# get cavaliba
wget https://cavaliba.com/download/cavaliba/latest.tar.gz
tar zxvf latest.tar.gz
cd 3.X.Y/  

# setup python dependencies with uv
cd source
uv sync

# setup a local small redis server for async tasks 
sudo apt install redis
sudo systemctl start redis-server
sudo systemctl status redis-server
sudo systemctl enable redis-server
redis-cli


# start (2 shells windows if task needed)
# see script content for dev passwords and options
cd source
./start_dev.sh app
./start_dev.sh task

# load demo data (optional)
uv run manage.py cavaliba load builtin/demo    # optional

# run integrated test suite
uv run manage.py test

    DJANGO DEBUG TOOLBAR: ON
    Found 540 test(s).
    Creating test database for alias 'default'...
    System check identified no issues (0 silenced).
    ............
    Ran 540 tests in 10.864s


# cleanup
ctrl-c            # to stop app and task  commands
rm db.sqlite3     # to remove the dev database
remove redis if not used 

You can access the Cavaliba dev system on http://localhost:8000/. You will notice a small sqlite database in the folder above source. You’re un DEBUG mode. Every change to python or html/css/js code is immediately reloaded.

Integrated test suite

First, either create an empty test database in your database server or use the root DµB user in your docker .env file for variable CAVALIBA_DB_USER. Alternatively you may prefer to grant create database privileges to your current CAVALIBA_DB_USER.

Then,

$ cavmanage test

Options exists such as:

$ cavmanage test --keepdb
$ cavmanage test -v 2
$ cavmanage test --keepdb app_home.tests.test_home.ConfTest

You may need to create a test database manually in MariaDB. Example:

docker exec -it cavaliba_db mysql -u root -p
create database test_cavaliba;
show grants for 'cavaliba';
GRANT ALL PRIVILEGES ON `test_cavaliba`.* TO `cavaliba`@`%`;
flush privileges;

Dependencies (3.31+)

cavaliba/source$ uv tree
Resolved 43 packages in 1ms
cavaliba v3.31.0
├── babel v2.18.0
├── celery v5.6.2
│   ├── billiard v4.2.4
│   ├── click v8.3.1
│   ├── click-didyoumean v0.3.1
│   │   └── click v8.3.1
│   ├── click-plugins v1.1.1.2
│   │   └── click v8.3.1
│   ├── click-repl v0.3.0
│   │   ├── click v8.3.1
│   │   └── prompt-toolkit v3.0.52
│   │       └── wcwidth v0.6.0
│   ├── kombu v5.6.2
│   │   ├── amqp v5.3.1
│   │   │   └── vine v5.1.0
│   │   ├── packaging v26.0
│   │   ├── tzdata v2025.3
│   │   └── vine v5.1.0
│   ├── python-dateutil v2.9.0.post0
│   │   └── six v1.17.0
│   ├── tzlocal v5.3.1
│   └── vine v5.1.0
├── django v5.2.12
│   ├── asgiref v3.11.1
│   └── sqlparse v0.5.5
├── django-redis v6.0.0
│   ├── django v5.2.12 (*)
│   └── redis v7.3.0
├── django-tinymce v3.6.1
├── gunicorn v25.1.0
│   └── packaging v26.0
├── html2text v2025.4.15
├── mysqlclient v2.2.8
├── psycopg2 v2.9.11
├── pyjwt v2.12.1
├── pyyaml v6.0.3
├── requests v2.32.5
    ├── certifi v2026.2.25
    ├── charset-normalizer v3.4.5
    ├── idna v3.11
    └── urllib3 v2.6.3