Skip to content
Andrea Peltrin edited this page Jul 6, 2023 · 11 revisions

First, install Coldsweat with pip or clone the repository into your installation directory, like explained in the main Readme file.

Configuration settings

Coldsweat to run needs two information:

  1. Where to store data. See Peewee's Database URL examples to configure your database of choice.
  2. Which secret key to use when generating session cookies to keep web users logged-in. See Flask documentation about secret keys on tips to pick secure values.

Such information can be specified in two ways.

1. Using a configuration file

By adding a config.toml file, using the TOML format. This boils down to write a series of key-value pairs like the example below:

DATABASE_URL="mysql://username:[email protected]:3306/coldsweat"
SECRET_KEY="192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf"

The config.toml file is loaded from the Flask instance_path, which for an installed package are either:

$PREFIX/lib/pythonX.Y/site-packages/coldsweat
$PREFIX/var/myapp-instance

Where $PREFIX is the prefix of your Python installation. This can be /usr or the path to your virtualenv. You can print the value of sys.prefix to see what the prefix is set to.

See Flask documentation on instance folders for more info.

2. Using environment variables

Another approach is using environment variables and assign their values to names prefixed by FLASK_:

export FLASK_DATABASE_URL="mysql://username:[email protected]:3306/coldsweat"
export FLASK_SECRET_KEY="192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf"

Deploy

Please take look at the Deploy page.

Clone this wiki locally