|
|
@ -15,9 +15,14 @@ app.secret_key = 'PiracyIsCool'
|
|
|
|
|
|
|
|
|
|
|
|
now = datetime.datetime.now()
|
|
|
|
now = datetime.datetime.now()
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("test")
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/test', methods=['GET'])
|
|
|
|
def test():
|
|
|
|
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'])
|
|
|
|
@app.route('/', methods=['GET'])
|
|
|
|
def index():
|
|
|
|
def index():
|
|
|
@ -71,7 +76,7 @@ def bookrequest():
|
|
|
|
return render_template('public/upload_book.html', books=books)
|
|
|
|
return render_template('public/upload_book.html', books=books)
|
|
|
|
|
|
|
|
|
|
|
|
# from POST /submit store data in the database and forward to the request
|
|
|
|
# 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():
|
|
|
|
def submit():
|
|
|
|
book = dict(title=request.form['title'], author=request.form['author'], publisher=request.form['publisher'], year=request.form['year'], extention=request.form['extention'])
|
|
|
|
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)
|
|
|
|
table.insert(book)
|
|
|
|