diff options
author | B Stack <bgstack15@gmail.com> | 2022-02-15 10:34:40 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2022-02-15 10:34:40 -0500 |
commit | 030f2cf270a486f317fcb4b9e168ccc4cfcfb640 (patch) | |
tree | 2489eb96f969133e4b94e9c5f86e999a14bb88de /stackbin.py | |
parent | fix wsgi pidfile, user homedir, and INI loading (diff) | |
download | stackbin-030f2cf270a486f317fcb4b9e168ccc4cfcfb640.tar.gz stackbin-030f2cf270a486f317fcb4b9e168ccc4cfcfb640.tar.bz2 stackbin-030f2cf270a486f317fcb4b9e168ccc4cfcfb640.zip |
load stackbin_conf from env
Diffstat (limited to 'stackbin.py')
-rwxr-xr-x | stackbin.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stackbin.py b/stackbin.py index 1b08b43..f4059f0 100755 --- a/stackbin.py +++ b/stackbin.py @@ -9,6 +9,7 @@ from flask import (Flask, request, url_for, redirect, g, render_template, sessio from flask_sqlalchemy import SQLAlchemy from werkzeug.middleware.proxy_fix import ProxyFix from pytimeparse.timeparse import timeparse # python3-pytimeparse +import os # uwsgidecorators load will fail when using initdb.py but is also not necessary try: from uwsgidecorators import timer # python3-uwsgidecorators @@ -52,7 +53,10 @@ def get_unsigned(string, salt="blank"): return Signer(app.secret_key, salt=salt).unsign(str(string)).decode("utf-8") app = Flask(__name__) -app.config.from_pyfile('stackbin.conf') +try: + app.config.from_pyfile(os.environ['STACKBIN_CONF']) +except: + app.config.from_pyfile('stackbin.conf') db = SQLAlchemy(app) if "STATIC_FOLDER" in app.config: app.static_folder=app.config["STATIC_FOLDER"] |