add config.ini and save db during upgrade

This commit is contained in:
fram3d 2024-01-18 14:32:53 +01:00
parent 6ce7ab25d9
commit b74c6a87b9
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
2 changed files with 10 additions and 0 deletions

2
flaskapp/config.ini Normal file
View File

@ -0,0 +1,2 @@
[sectionname]
CONFIGVARIABLE = testvalue

View File

@ -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():