Installing with a Database (Windows) - Samuel-Buteau/universal-battery-database GitHub Wiki

All the commands (starting with >) should be run in Command Prompt.

1. Create and activate a new Python environment.

2. Install requirements.

>pip3 install -r requirements.txt

3. Install PostgreSQL.

There is a separate process to choose a driver after the PostgreSQL installation. Make sure that the installation includes the PostgreSQL Unicode ODBC driver (e.g. ODBC 64-bit).

Follow the installation instructions to create a default user (referred to in this tutorial as default_username, typically set to postgres) and a default password (referred to in this tutorial as default_password).

4. Add the bin path of the install to the Path variable.

5. Connect your default user and create a database.

>psql -U default_username

default_username is the one created in Step 3 (typically just postgres). When prompted, enter the corresponding default_password, also from Step 3.

Pick your own your_database_name, your_username, your_password (the latter two can be the same as the default ones from Step 3). Enter the following three commands:

CREATE DATABASE your_database_name;
CREATE USER your_username WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;

6. Setting up configuration.

Pick a good your_secret_key for data security. Then, create a new file cycling/config.ini that contains the following:

[DEFAULT]
Database = your_database_name
User = your_username
Password = your_password
Host = localhost
Port = 5432
Backend = postgresql
SecretKey = your_secret_key