Dev

Setup a DEV environment with UV

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
cd source
uv sync

# start (no login)
cd source
./start_dev.sh


# manual start with custom admin password
uv run manage.py migrate
uv run manage.py createsuperuser               # here, choose a password for the builtin admin account
uv run manage.py cavaliba start
uv run manage.py runserver 0.0.0.0:8000


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

# run integrated test suite

source$ uv run manage.py test
DJANGO DEBUG TOOLBAR: ON
Found 308 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
....................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 308 tests in 10.864s


# cleanup

ctrl-c to stop the runserver command

rm db.sqlite3     # to remove the dev database

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.

Async tasks (celery) are not available in this standalone mode. You need to use a redis cache and a separate celery groups or worker process. You may instead build a local Docker image and launch a full stack with docker-compose.

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