Skip to content

Commit

Permalink
Add minimal and dev toml-config example files
Browse files Browse the repository at this point in the history
  • Loading branch information
podliashanyk committed May 31, 2024
1 parent b3f8ad9 commit 7692e0a
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 59 deletions.
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ Running Howitz step-by-step overview
The easiest way to configure Howitz is via a ``toml`` file.

1. Create an empty ``.howitz.toml`` file in the project root folder.
2. Copy the values from the example config file ``dev-howitz.toml`` to ``.howitz.toml``.
2. Copy the values from the preferred example config file ``howitz.*.toml.example`` to ``.howitz.toml``. Here using the ``howitz.min.toml.example``::

$ cp howitz.min.toml.example .howitz.toml

3. Open ``.howitz.toml`` and fill out at least the config values: ``SECRET_KEY`` and ``server``. Those values are left empty in the example config file.
4. Play around with the config values in ``.howitz.toml``, if desired.

Expand Down Expand Up @@ -254,7 +257,7 @@ than ``LOCAL`` and ``UTC`` provided in config will be ignored and fall back to `
Example config-file for development
-----------------------------------

For development, copy the contents of the included file ``dev-howitz.toml`` to ``.howitz.toml`` in the same directory.
For development, copy the contents of the included file ``howitz.dev.toml.example`` to ``.howitz.toml`` in the same directory.

1. Set ``[flask] -> SECRET_KEY`` to some long string.
2. Set ``[zino.connections.default] -> server`` to the address of a Zino 1 server.
Expand Down
57 changes: 0 additions & 57 deletions dev-howitz.toml

This file was deleted.

56 changes: 56 additions & 0 deletions howitz.dev.toml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[flask]
SECRET_KEY =
DEBUG = true

[howitz]
storage = "./howitz.sqlite3"
devmode = true
poll_interval = 60
timezone='LOCAL'

[zino.connections.default]
server =

## Comment out and fill out in order to configure another Zino server profile
#[zino.connections.other]
#server =

[logging]
version = 1

[logging.root]
level = "ERROR"

# Tweak in order to configure desired logging level
[logging.formatters.default]
format = "%(levelname)s %(name)s in %(funcName)s: %(message)s"

[logging.formatters.detail]
format = "%(asctime)s %(levelname)s %(name)s %(pathname)s:%(lineno)s:: %(message)s"

[logging.handlers.null]
class = "logging.NullHandler"

[logging.handlers.wsgi]
class = "logging.StreamHandler"
stream = "ext://flask.logging.wsgi_errors_stream"
formatter = "default"

[logging.handlers.error]
level = "WARNING"
class = "logging.FileHandler"
filename = "errors.log"
formatter = "detail"

[logging.handlers.debug]
level = "DEBUG"
class = "logging.handlers.TimedRotatingFileHandler"
filename = "debug.log"
when = 'D'
formatter = "detail"

[logging.loggers.zinolib]
handlers = ["debug", "wsgi"]

[logging.loggers.howitz]
handlers = ["debug", "wsgi"]
18 changes: 18 additions & 0 deletions howitz.min.toml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[flask]
SECRET_KEY =
DEBUG = true

[howitz]
storage = "./howitz.sqlite3"
devmode = true
poll_interval = 60
timezone='LOCAL'

[zino.connections.default]
server =

[logging]
version = 1

[logging.root]
level = "ERROR"

0 comments on commit 7692e0a

Please sign in to comment.