views routes all have / at start

master
Castro0o 4 years ago
parent d23e4857af
commit 91508a6d73

@ -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"<a href='{index}'>index</a><br/><a href='{about}'>about</a>"
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)

Loading…
Cancel
Save