add models and index route

This commit is contained in:
2024-01-15 20:15:44 +01:00
parent 872e0e2416
commit dd142693d9
2 changed files with 15 additions and 12 deletions

View File

@@ -5,15 +5,8 @@ from taskmanager.models import *
@app.route('/', methods=['GET'])
def index():
if request.method == 'GET':
localvariable1 = "Placeholder1"
localvariable1 = "Placeholder2"
try:
return render_template('index.html', pagevariable1 = localvariable1, pagevariable2 = localvariable2 )
except:
return 'Error retriving page'
else:
return 'HTTP request method not recogniezed'
tasks = Task.query.all()
return render_template('index.html', tasks = tasks)
@app.route('/submit', methods=['POST', 'GET'])
def submit():