fix
This commit is contained in:
parent
998ff03f67
commit
4efb65ea44
5
app.py
5
app.py
@ -19,7 +19,7 @@ def index():
|
|||||||
cs.execute(statement)
|
cs.execute(statement)
|
||||||
return render_template("index.html", comments=cs.fetchall())
|
return render_template("index.html", comments=cs.fetchall())
|
||||||
|
|
||||||
@app.route('/submit', methods=["POST"])
|
@app.route('/gb/submit', methods=["POST"])
|
||||||
def submit():
|
def submit():
|
||||||
errors = []
|
errors = []
|
||||||
name = request.form.get("name")
|
name = request.form.get("name")
|
||||||
@ -46,4 +46,5 @@ def submit():
|
|||||||
values = (name, website, comment, int(time.time()), str(request.remote_addr))
|
values = (name, website, comment, int(time.time()), str(request.remote_addr))
|
||||||
cs.execute(statement, values)
|
cs.execute(statement, values)
|
||||||
db.commit()
|
db.commit()
|
||||||
return redirect("/")
|
#change this if you run it on anything other than /gb
|
||||||
|
return redirect("/gb")
|
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="static/style.css">
|
<link rel="stylesheet" href="static/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form method="POST" action="submit">
|
<form method="POST" action="/gb/submit">
|
||||||
<input name="name" placeholder="Name (optional)">
|
<input name="name" placeholder="Name (optional)">
|
||||||
<input name="website" placeholder="Website (optional, w/o the http(s) part)">
|
<input name="website" placeholder="Website (optional, w/o the http(s) part)">
|
||||||
<textarea name="comment" placeholder="Comment (max 512 characters)"></textarea>
|
<textarea name="comment" placeholder="Comment (max 512 characters)"></textarea>
|
||||||
|
Loading…
Reference in New Issue
Block a user