From e25c28b04c40e3a45fa92f15b8904dc64b64bdba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Fri, 27 Nov 2020 05:49:29 +0100 Subject: [PATCH] basic temapltes rendered --- .travis.yml | 2 ++ requirements.txt | 4 +++- src/app.py | 8 ++++---- src/templates/base.html | 12 ++++++------ src/templates/index.html | 6 +++--- src/templates/item.html | 8 ++------ src/templates/login.html | 17 ----------------- src/templates/profile.html | 12 ++++++------ src/templates/register.html | 18 ------------------ src/templates/security/login_user.html | 20 ++++++++++++++++++++ src/templates/security/register_user.html | 22 ++++++++++++++++++++++ src/templates/upload.html | 2 +- src/utils/__init__.py | 1 - src/views/__init__.py | 3 +-- src/views/indexview.py | 23 +++++++++++++++++++++++ src/views/itemview.py | 9 +++++++++ src/views/loginview.py | 18 ------------------ src/views/profileview.py | 3 +++ src/views/registerview.py | 18 ------------------ src/views/uploadview.py | 3 +++ 20 files changed, 108 insertions(+), 101 deletions(-) delete mode 100644 src/templates/login.html delete mode 100644 src/templates/register.html create mode 100644 src/templates/security/login_user.html create mode 100644 src/templates/security/register_user.html create mode 100644 src/views/indexview.py delete mode 100644 src/views/loginview.py delete mode 100644 src/views/registerview.py diff --git a/.travis.yml b/.travis.yml index ce6c922..b1f9830 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: python +python: + - "3.9" arch: amd64 os: linux dist: focal diff --git a/requirements.txt b/requirements.txt index 96c9830..6411bf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,6 @@ py-healthcheck sqlalchemy flask-sqlalchemy flask-cors -requests \ No newline at end of file +requests +psycopg2-binary +email_validator \ No newline at end of file diff --git a/src/app.py b/src/app.py index 430bf4c..31ff5c5 100644 --- a/src/app.py +++ b/src/app.py @@ -9,8 +9,8 @@ from flask_cors import CORS from utils.config import SENTRY_DSN, RELEASE_ID, RELEASEMODE, POSTGRES_DB, PORT, POSTGRES_HOSTNAME, POSTGRES_PASSWORD, \ POSTGRES_USERNAME, DEBUG, SECRET_KEY, ALLOWED_ORIGINS -from utils import db, ma, health_database_status, security, user_datastore -from views import ItemView, LoginView, ProfileView, RegisterView, UploadView +from utils import db, health_database_status, security, user_datastore +from views import ItemView, ProfileView, UploadView, IndexView """ Main Flask entrypoint @@ -37,10 +37,10 @@ app.config['SQLALCHEMY_DATABASE_URI'] = \ f"postgresql://{POSTGRES_USERNAME}:{POSTGRES_PASSWORD}@{POSTGRES_HOSTNAME}:5432/{POSTGRES_DB}" app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SECRET_KEY'] = SECRET_KEY +app.config['SECURITY_REGISTERABLE'] = True health = HealthCheck() db.init_app(app) -ma.init_app(app) security.init_app(app, user_datastore) CORS(app, origins=ALLOWED_ORIGINS) @@ -55,7 +55,7 @@ logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(handler) -for view in [ItemView, LoginView, ProfileView, RegisterView, UploadView]: +for view in [ItemView, ProfileView, UploadView, IndexView]: view.register(app, trailing_slash=False) health.add_check(health_database_status) diff --git a/src/templates/base.html b/src/templates/base.html index ed75cde..d4fc9ad 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -6,12 +6,12 @@ - My Store Web App + UnstableVortex CAFF Store