-
Notifications
You must be signed in to change notification settings - Fork 21
Setup
First, install Coldsweat with pip
or clone the repository into your installation directory, like explained in the main Readme file.
Coldsweat to run needs two information:
- Where to store data. See Peewee's Database URL examples to configure your database of choice.
- 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.
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/coldsweat-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.
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"
Please take look at the Deploy page.