version number and site name

This commit is contained in:
Ville Rantanen
2018-02-18 09:56:31 +02:00
parent 46e9cea720
commit 57b799472f
5 changed files with 13 additions and 4 deletions

View File

@@ -11,10 +11,12 @@ import hashlib
import zipfile
from revprox import ReverseProxied
__FLEES_VERSION__ = "20180218.0"
app = Flask(__name__)
app.config.from_object(__name__)
# Read config from json !
config_values = json.load(open(os.getenv('FLEES_CONFIG'),'rt'))
app.config['SITE_NAME'] = config_values['site_name']
app.config['UPLOAD_FOLDER'] = config_values['data_folder']
app.config['SHARES_FILE'] = config_values['shares_file']
app.config['ZIP_FOLDER'] = config_values['zip_folder']
@@ -30,6 +32,8 @@ app.wsgi_app = ReverseProxied(app.wsgi_app)
@app.before_request
def before_request():
g.shares = json.load(open(app.config['SHARES_FILE'],'rt'))
g.version = __FLEES_VERSION__
g.site_name = app.config['SITE_NAME']
@app.route("/")
def index():