This commit is contained in:
Alexandru 2024-09-17 21:39:46 +03:00
parent 58ae586d7b
commit ccdd13a188

4
app.py
View File

@ -13,13 +13,13 @@ app.secret_key = hashlib.md5(os.urandom(32)).hexdigest()
def parsetime(value):
return time.strftime('%Y-%m-%d %H:%M', time.localtime(value))
@app.route('/gb')
@app.route('/')
def index():
statement = 'SELECT "id", "name", "website", "comment", "date", "ip" FROM "entries" ORDER BY id DESC'
cs.execute(statement)
return render_template("index.html", comments=cs.fetchall())
@app.route('/gb/submit', methods=["POST"])
@app.route('/submit', methods=["POST"])
def submit():
errors = []
name = request.form.get("name")