aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2021-02-25 21:15:24 -0500
committerGalen Guyer <galen@galenguyer.com>2021-02-25 21:15:24 -0500
commit72b07e05e50c2c93d6f195a3ebe15544c4afe171 (patch)
tree93e71b32b9b9295126008bc037756a4be320bcdf
parent2db9fcf921c5302336dfd3bc72983692b345d2aa (diff)
Update config file
-rw-r--r--config.env.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/config.env.py b/config.env.py
index 6726cb3..8334eeb 100644
--- a/config.env.py
+++ b/config.env.py
@@ -1,15 +1,18 @@
-import secrets
-import os
+"""
+Default configuration settings and environment variable based configuration logic
+ See the readme for more information
+"""
-# 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.
+from os import environ
+import secrets
+# Flask config
+DEBUG = False
+IP = environ.get('POLLER_IP', 'localhost')
+PORT = environ.get('POLLER_PORT', '8000')
+PROTOCOL = environ.get('POLLER_PROTOCOL', 'http://')
+SECRET_KEY = environ.get('POLLER_SECRET_KEY', default=''.join(secrets.token_hex(16)))
-# Defaults for flask configuration
-IP = os.environ.get('IP', '127.0.0.1')
-PORT = os.environ.get('PORT', 5000)
-SECRET_KEY = os.environ.get('SESSION_KEY', default=''.join(secrets.token_hex(16)))
+# SQLAlchemy config
+SQLALCHEMY_DATABASE_URI = environ.get('POLLER_DATABASE_URI', 'sqlite:////tmp/rit-covid-poller.db')
+SQLALCHEMY_TRACK_MODIFICATIONS = False