From 91508a6d73a10cc02728e7d23f28b4ab71412e5f Mon Sep 17 00:00:00 2001 From: Castro0o Date: Fri, 12 Jun 2020 15:10:43 +0200 Subject: [PATCH] views routes all have / at start --- app/views.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views.py b/app/views.py index 683f335..d6e4b7e 100644 --- a/app/views.py +++ b/app/views.py @@ -15,9 +15,14 @@ app.secret_key = 'PiracyIsCool' now = datetime.datetime.now() -@app.route("test") + +@app.route('/test', methods=['GET']) def test(): - return redirect('.'+url_for('index')) + index = url_for('index') + about = url_for('about') + links = f"index
about" + return links + @app.route('/', methods=['GET']) def index(): @@ -71,7 +76,7 @@ def bookrequest(): return render_template('public/upload_book.html', books=books) # from POST /submit store data in the database and forward to the request -@app.route('submit', methods=['POST']) +@app.route('/submit', methods=['POST']) def submit(): book = dict(title=request.form['title'], author=request.form['author'], publisher=request.form['publisher'], year=request.form['year'], extention=request.form['extention']) table.insert(book)