diff options
author | Galen Guyer <galen@galenguyer.com> | 2021-03-01 20:02:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 20:02:34 -0500 |
commit | 8139cc88f9a2ce69909b1c9ed57b70fda15dbbf8 (patch) | |
tree | d61df9691f62952643b5062b32aaac4fdb09df6e /config.env.py | |
parent | d1bbe068e77e2504d6e300fdf586ddd8afc29a2f (diff) | |
parent | 0d57a01ba2c4da533ad4459fcf5a45b79a17cd53 (diff) |
Merge pull request #1 from galenguyer/v2
v2 - SQLAlchemy
Diffstat (limited to 'config.env.py')
-rw-r--r-- | config.env.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/config.env.py b/config.env.py index fd7c9ac..a56a930 100644 --- a/config.env.py +++ b/config.env.py @@ -1,17 +1,19 @@ -import secrets -import os - -# Values in this file are loaded into the flask app instance, `demo.APP` in this -# demo. This file sources values from the environment if they exist, otherwise a -# set of defaults are used. This is useful for keeping secrets secret, as well -# as facilitating configuration in a container. Defaults may be overriden either -# by defining the environment variables, or by creating a `config.py` file that -# contains locally set secrets or config values. +""" +Default configuration settings and environment variable based configuration logic + See the readme for more information +""" +from os import environ +import secrets -# Defaults for flask configuration -IP = os.environ.get('IP', '127.0.0.1') -PORT = os.environ.get('PORT', 5000) -#SERVER_NAME = os.environ.get('SERVER_NAME', 'localhost:5000') -SECRET_KEY = os.environ.get('SESSION_KEY', default=''.join(secrets.token_hex(16))) +# Flask config +DEBUG = False +IP = environ.get('POLLER_IP', 'localhost') +PORT = environ.get('POLLER_PORT', '5000') +SECRET_KEY = environ.get('POLLER_SECRET_KEY', default=''.join(secrets.token_hex(16))) +LOG_LEVEL = environ.get('PACKET_LOG_LEVEL', 'INFO') +VERSION = '0.1.0' +# SQLAlchemy config +SQLALCHEMY_DATABASE_URI = environ.get('POLLER_DATABASE_URI', f'sqlite:///data.db') +SQLALCHEMY_TRACK_MODIFICATIONS = False |