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 %} +