From 7cb3aaf864df2fbd7d2903dd10dfef8fe55c0669 Mon Sep 17 00:00:00 2001 From: William Peebles Date: Sat, 12 Nov 2022 21:57:42 -0500 Subject: [PATCH] begin auth stuff --- app.py | 4 ++++ auth.py | 12 ++++++++++++ templates/login.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 auth.py create mode 100644 templates/login.html diff --git a/app.py b/app.py index fbe442a..b4f52be 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,7 @@ from flask_sqlalchemy import SQLAlchemy basedir = os.path.abspath(os.path.dirname(__file__)) app = Flask(__name__) +app.config['SECRET_KEY'] = 'HwG55rpe83jcaglifXm8NuF4WEeXyJV4' app.config['SQLALCHEMY_DATABASE_URI'] =\ 'sqlite:///' + os.path.join(basedir, 'database.db') app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False @@ -13,6 +14,9 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) +from auth import auth as auth_blueprint +app.register_blueprint(auth_blueprint) + class Period(db.Model): period = db.Column(db.Integer, primary_key=True) periodTime = db.Column(db.Integer) diff --git a/auth.py b/auth.py new file mode 100644 index 0000000..3e971fd --- /dev/null +++ b/auth.py @@ -0,0 +1,12 @@ +from flask import Blueprint, render_template +from app import db + +auth = Blueprint('auth', __name__) + +@auth.route('/login') +def login(): + return render_template('login.html') + +@auth.route('/logout') +def logout(): + return 'Logout' \ No newline at end of file diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..c006214 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} + +{% block content %} +
+

Login

+
+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+{% endblock %} \ No newline at end of file