-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (22 loc) · 772 Bytes
/
main.py
File metadata and controls
30 lines (22 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from flask import Flask, request, render_template
from wtforms import Form, TextField
import database
app = Flask("SmallStuff")
app.debug = True
DB = database.Database()
@app.route("/")
def index():
return render_template('basic.html', title = "SmallStuff")
@app.route("/greet")
def greet():
return render_template('new_exercise.html', name = "Jason", title = "SmallStuff")
class NewExerciseForm(Form):
exercise_name = TextField("Exercise Name")
@app.route("/new_exercise", methods = ['GET', 'POST'])
def new_exercise():
form=NewExerciseForm(request.form)
if request.method == 'POST':
return form.exercise_name.data
return render_template('new_exercise.html', form=form)
if __name__ == '__main__':
app.run(host="192.168.1.110")