Files
jonnybravo c0cfe686d1
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after -56s
switch to ras-dan-01
2025-03-31 15:21:28 +02:00

47 lines
1.0 KiB
Python

from flask import Flask, render_template, request, session
import modify_csv
import read_cat
app = Flask(__name__)
app.secret_key = "Start1234!"
@app.get("/")
def index():
return render_template(
"index.html",
sitename="Ausgaben der Familie",
data=modify_csv.read_csv_file(),
sum_all=modify_csv.sum_all(),
)
@app.get("/add_ausgabe")
def add_ausgabe():
return render_template(
"add_ausgabe.html",
url="output",
select_id_text="add_value",
select_id="add_disc",
data=read_cat.read_cat_file(),
)
@app.post("/output")
def csv_output():
modify_csv.write_csv_file(
betrag=request.form["add_value"], select_dist=request.form["add_disc"]
)
return render_template(
"index.html",
csv_value_text=request.form["add_value"],
csv_value_disc=request.form["add_disc"],
data=modify_csv.read_csv_file(),
sum_all=modify_csv.sum_all(),
)
if __name__ == "__main__":
app.run(port=5080, host="0.0.0.0", debug=True)