Skip to content

Local installation (PC)

A local installation runs on a single computer (typically a laptop at the entrance) with an SQLite database. Other devices on the same network (phone, tablet) connect to it via the computer's IP address.

Requirements

  • Python 3.11 or newer. On Windows, tick Add Python to PATH during installation.
  • Git, or the repository downloaded as a ZIP.
  • The app's port open in the firewall (default 8000) if other devices should connect.

Windows: install scripts

The repository root contains ready-made scripts:

Script What it does
install_app.bat Creates a virtual environment, installs packages, runs migrations and offers to create an administrator.
start_server.bat Starts the server with HTTPS on port 8000 and opens the browser at https://127.0.0.1:8000.
update_app.bat Checks for a new version, downloads it and runs migrations.

Open the port in the firewall with (CMD run as administrator):

netsh advfirewall firewall add rule name="OdbavTo" protocol=TCP dir=in localport=8000 action=allow profile=private,domain

Manual installation

1. Download and virtual environment

git clone https://github.com/michaelkalus/OdbavTo.git
cd OdbavTo
python -m venv venvTBM

Activate the environment:

venvTBM\Scripts\activate
Set-ExecutionPolicy Unrestricted -Scope Process
venvTBM\Scripts\Activate.ps1
source venvTBM/bin/activate

2. Packages and configuration

pip install -r requirements.txt
cp .env.example .env        # Windows: copy .env.example .env

In .env, set your own SECRET_KEY and add the computer's IP address to ALLOWED_HOSTS:

SECRET_KEY=<random-string>
ALLOWED_HOSTS=127.0.0.1,localhost,192.168.1.50

3. Database and users

python manage.py migrate
python manage.py createsuperuser     # administrator for /admin/

On an empty database, migrations also create a regular user odbavto / odbavto. Change the password after the first login.

4. Run with HTTPS

The camera and WebUSB require HTTPS. A self-signed certificate is enough on a local network:

python manage.py runserver_plus 0.0.0.0:8000 --cert-file cert.crt --key-file cert.key

If the certificate files don't exist, they are generated. Open https://127.0.0.1:8000 (from another device https://<computer-ip>:8000) and accept the browser's certificate warning.

WebSockets and the agent

Printing via the agent or WebSocket needs a running Redis (REDIS_HOST, REDIS_PORT). WebUSB, network printing and Direct do not need Redis.

Updating

git pull
pip install -r requirements.txt
python manage.py migrate

Then restart the server. On Windows, just run update_app.bat.