From 72b07e05e50c2c93d6f195a3ebe15544c4afe171 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Thu, 25 Feb 2021 21:15:24 -0500 Subject: Update config file --- config.env.py | 27 +++++++++++++++------------ 1 file 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 -- cgit v1.2.3