fallback to example settings

if no setting file is given
This commit is contained in:
Aaron Kimbre 2022-03-13 19:27:23 -05:00
parent 418c81944b
commit f0faa4c53b
2 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,8 @@ def register_settings(app):
try:
app.config.from_object('app.settings')
except Exception:
print("Not using settings.py")
app.logger.info("No settings.py, loading from example")
app.config.from_object('app.settings_example')
# Load environment specific settings
app.config['TESTING'] = False
@ -192,7 +193,8 @@ def register_settings(app):
'APP_DATABASE_URI',
app.config['APP_DATABASE_URI']
)
if app.config['SECRET_KEY'] is None or app.config['APP_DATABASE_URI'] is None:
raise("No database uri or secret Key")
# try to get overides, otherwise just use what we have already
app.config['USER_ENABLE_REGISTER'] = os.getenv(
'USER_ENABLE_REGISTER',