Rename var
This commit is contained in:
12
app.py
12
app.py
@@ -7,7 +7,7 @@ app = Flask(__name__)
|
|||||||
app.config['SECRET_KEY'] = 'j69ol5mcHLsEtLg4Y/+myd9wWD4pp56E'
|
app.config['SECRET_KEY'] = 'j69ol5mcHLsEtLg4Y/+myd9wWD4pp56E'
|
||||||
|
|
||||||
# setup logging
|
# setup logging
|
||||||
formatter = logging.Formatter( # pylint: disable=invalid-name
|
formatter = logging.Formatter(
|
||||||
'%(asctime)s %(levelname)s %(process)d ---- %(threadName)s '
|
'%(asctime)s %(levelname)s %(process)d ---- %(threadName)s '
|
||||||
'%(module)s : %(funcName)s {%(pathname)s:%(lineno)d} %(message)s','%Y-%m-%dT%H:%M:%SZ')
|
'%(module)s : %(funcName)s {%(pathname)s:%(lineno)d} %(message)s','%Y-%m-%dT%H:%M:%SZ')
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
@@ -18,7 +18,7 @@ app.logger.info('Starting erdbeerhannah v1.0.5')
|
|||||||
|
|
||||||
Bootstrap(app)
|
Bootstrap(app)
|
||||||
|
|
||||||
requestcounter = 0
|
postcounter = 0
|
||||||
gesamtwert = 0
|
gesamtwert = 0
|
||||||
change = 0
|
change = 0
|
||||||
givenfloat = 0
|
givenfloat = 0
|
||||||
@@ -32,11 +32,11 @@ item6 = 0
|
|||||||
|
|
||||||
@app.route("/", methods=["GET", "POST"])
|
@app.route("/", methods=["GET", "POST"])
|
||||||
def index():
|
def index():
|
||||||
global gesamtwert, item1, item2, item3, item4, item5, item6, sum, givenfloat, change, given, background, requestcounter
|
global gesamtwert, item1, item2, item3, item4, item5, item6, sum, givenfloat, change, given, background, postcounter
|
||||||
background = "bg-white"
|
background = "bg-white"
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
requestcounter += 1
|
postcounter += 1
|
||||||
# wert = float(request.form["wert"])
|
# wert = float(request.form["wert"])
|
||||||
wert = request.form.get('wert', "0", type=float)
|
wert = request.form.get('wert', "0", type=float)
|
||||||
given = request.form.get('given', "0", type=float)
|
given = request.form.get('given', "0", type=float)
|
||||||
@@ -101,7 +101,7 @@ def index():
|
|||||||
session['given'] = givenfloat
|
session['given'] = givenfloat
|
||||||
|
|
||||||
app.logger.info('*** sum %s, given %s, change %s', sum, givenfloat, change)
|
app.logger.info('*** sum %s, given %s, change %s', sum, givenfloat, change)
|
||||||
app.logger.info('*** requestcounter %s', requestcounter)
|
app.logger.info('*** postcounter %s', postcounter)
|
||||||
|
|
||||||
return render_template("index.html", gesamtwert=session.get('summestring', 0),
|
return render_template("index.html", gesamtwert=session.get('summestring', 0),
|
||||||
change=session.get('change', 0),
|
change=session.get('change', 0),
|
||||||
@@ -126,4 +126,4 @@ def favicon():
|
|||||||
# 'about.html')
|
# 'about.html')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True, host='0.0.0.0')
|
app.run(debug=True, host='127.0.0.1')
|
Reference in New Issue
Block a user