From b24d05e77d97bda615db0a377557f6eeffcb74ec Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 1 Jun 2018 20:40:45 +0200 Subject: [PATCH] changed port to 8080 - keep it uniform with views.py --- app/models.py | 2 -- app/views.py | 8 ++++---- run.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/models.py b/app/models.py index 1aaf5b0..792cc0c 100755 --- a/app/models.py +++ b/app/models.py @@ -95,8 +95,6 @@ class BookSchema(Schema): - - def must_not_be_blank(data): if not data: raise ValidationError('You forgot to write stuff.') diff --git a/app/views.py b/app/views.py index cbf92e4..a77b309 100755 --- a/app/views.py +++ b/app/views.py @@ -66,7 +66,7 @@ def show_books(): return redirect((url_for('search_results', query=search.search.data))) if search.select.data == 'Category': return redirect((url_for('search_cat', query=search.search.data))) - + return render_template('show_books.html', books=books, form=search) @app.route('/scape', methods=['POST', 'GET']) @@ -148,8 +148,8 @@ def add_book(): upload_form = UploadForm() if request.method == 'POST': - title = upload_form.title.data - authors = upload_form.author.data + title = upload_form.title.data + authors = upload_form.author.data category = upload_form.category.data year_published = upload_form.year_published.data @@ -311,7 +311,7 @@ def get_books(): @app.route('/api/books/', methods=['GET']) def get_book_by_id(id): book = Book.query.get(id) - data, error = book_schema.dump(book) + data = book_schema.dump(book) if not data: return jsonify({"message": "Book could not be found."}), 400 else: diff --git a/run.py b/run.py index 9b4e490..48257b9 100755 --- a/run.py +++ b/run.py @@ -1,3 +1,3 @@ #! /usr/bin/env python from app import app -app.run(debug=True,host="0.0.0.0",port=8000) +app.run(debug=True,host="0.0.0.0",port=8080)