From 13a7c6c38313fd5f574452fedc2c79b739baf71d Mon Sep 17 00:00:00 2001 From: Mik Watkins <63586831+Mikerniker@users.noreply.github.com> Date: Fri, 8 Mar 2024 03:07:40 +0800 Subject: [PATCH] add home function and create User database --- Day89/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Day89/main.py b/Day89/main.py index 05d6343..60eee61 100644 --- a/Day89/main.py +++ b/Day89/main.py @@ -31,6 +31,14 @@ class Todo(db.Model): end_field = db.Column(db.Time()) status = db.Column(db.String(250)) + +class User(UserMixin, db.Model): + __tablename__ = "user" + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String(100), unique=True) + password = db.Column(db.String(100)) + name = db.Column(db.String(1000)) + # with app.app_context(): # db.create_all() @@ -66,6 +74,11 @@ def logout(): +@app.route("/", methods=["GET", "POST"]) +def home(): + return render_template("home.html") + + @app.route("/register", methods=["GET", "POST"]) def register():