aboutsummaryrefslogtreecommitdiff
path: root/stackbin.py
diff options
context:
space:
mode:
Diffstat (limited to 'stackbin.py')
-rwxr-xr-xstackbin.py6
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"]
bgstack15