|
|
|
@ -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)
|
|
|
|
|