From 27376f4a88169bcb2a698d597fec817b53a49f60 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 30 Nov 2021 22:16:10 +0100 Subject: [PATCH] run on sqlite and be more stable --- app/__init__.py | 4 ++-- app/forms.py | 6 +++--- app/models.py | 3 +-- app/static/css/style.css | 14 ++++++++------ app/templates/base.html | 3 ++- app/templates/header.html | 5 +++-- app/templates/scape_new.html | 2 +- app/templates/show_books.html | 4 +--- app/views.py | 32 ++++++++++++-------------------- requirements.txt | 26 -------------------------- 10 files changed, 33 insertions(+), 66 deletions(-) delete mode 100755 requirements.txt diff --git a/app/__init__.py b/app/__init__.py index 8a69b1f..8c6f89e 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -23,11 +23,11 @@ app = Flask(__name__) app.config['SECRET_KEY'] = 'super secret key' #app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/mydatabase.db' app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER -app.config['SQLALCHEMY_DATABASE_URI'] = 'rqlite+pyrqlite://localhost:4001/' +#app.config['SQLALCHEMY_DATABASE_URI'] = 'rqlite+pyrqlite://localhost:4001/' app.config['DEBUG'] = True app.config['PORT'] = 80 -#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db') +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db') db = SQLAlchemy(app) light = not os.path.isdir(UPLOAD_FOLDER) DOMAIN = environ.get('DOMAIN') diff --git a/app/forms.py b/app/forms.py index 6083f5a..6b57bed 100755 --- a/app/forms.py +++ b/app/forms.py @@ -5,7 +5,7 @@ from wtforms import FieldList from wtforms import Form as NoCsrfForm from wtforms.fields import StringField, FormField, SubmitField, SelectField, RadioField from app.models import Book, BookSchema, Author, Stack, StackSchema -from wtforms.fields.html5 import DecimalRangeField +from wtforms.fields import DecimalRangeField # - - - Forms - - - @@ -80,6 +80,6 @@ class SearchForm(FlaskForm): ('Outliers', 'Outliers')] select = SelectField('', choices=choices, default='All') search = StringField('', validators=[InputRequired()]) - grid = SubmitField('Grid') - listview = SubmitField('List') + # grid = SubmitField('Grid') + # listview = SubmitField('List') randomize = SubmitField('Order differently') diff --git a/app/models.py b/app/models.py index 076ca22..91a2192 100755 --- a/app/models.py +++ b/app/models.py @@ -1,8 +1,7 @@ from app import db from marshmallow import Schema, fields, ValidationError, pre_load import datetime -from sqlalchemy import Column, Integer, DateTime -import flask_whooshalchemyplus +from sqlalchemy import Column, DateTime authors = db.Table('books_authors', diff --git a/app/static/css/style.css b/app/static/css/style.css index 9f3d6a0..294fcfa 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -1,22 +1,23 @@ @import url("../fonts/fonts_style.css"); *{ -font-family: "Archivo Narrow"; +font-family: "Archivo Narrow", Helvetica, sans-serif; +} + +body{ + background-color: #f1f1f1; } p{ font-size: 20px; - - } a{ - text-decoration: underline; color: black; } -a:hover{ +a:hover{ text-decoration: underline; color: #0000FF; } @@ -291,7 +292,8 @@ font-size: 12px; left:0; position: fixed; font-size: 18px; - background-color: yellow; + background-color: rgb(0, 3, 170); + color: white; } #annotindication{ diff --git a/app/templates/base.html b/app/templates/base.html index ea3b2b7..67d5fdf 100755 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -50,7 +50,8 @@ - + +