diff --git a/flaskapp/config.ini b/flaskapp/config.ini new file mode 100644 index 0000000..9685910 --- /dev/null +++ b/flaskapp/config.ini @@ -0,0 +1,2 @@ +[sectionname] +CONFIGVARIABLE = testvalue diff --git a/flaskapp/routes.py b/flaskapp/routes.py index 30eefb5..17f6c38 100644 --- a/flaskapp/routes.py +++ b/flaskapp/routes.py @@ -2,6 +2,14 @@ from flask import render_template, request, redirect from flaskapp import app, db from flaskapp.functions import * from flaskapp.models import * +import configparser + +CONFIG_PATH = "/var/flaskapp/flaskapp/config.ini" + +config = configparser.ConfigParser() +config.read(CONFIG_PATH) + +CONFIGVARIABLE = config.get('sectionname', 'CONFIGVARIABLE') @app.route('/', methods=['GET']) def index():