From 514f0379688ef954af735ff0ac68c26e6f0d7790 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 5 Jun 2023 18:47:29 +0200 Subject: [PATCH] clean: rename page variale && add: panel and register --- home.py | 4 ++-- login.py | 4 ++-- main.py | 8 +++++--- panel.py | 7 +++++++ register.py | 7 +++++++ 5 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 panel.py create mode 100644 register.py diff --git a/home.py b/home.py index 403b0a1..a1d110d 100644 --- a/home.py +++ b/home.py @@ -1,7 +1,7 @@ import flask -home = flask.Blueprint("home", __name__, template_folder="templates") +page = flask.Blueprint("home", __name__, template_folder="templates") -@home.route("/") +@page.route("/") def show(): return (flask.render_template("home/index.html")) diff --git a/login.py b/login.py index bb8e47e..da7aa9d 100644 --- a/login.py +++ b/login.py @@ -1,8 +1,8 @@ import flask -login = flask.Blueprint("login", __name__, template_folder="templates") +page = flask.Blueprint("login", __name__, template_folder="templates") -@login.route("/login", methods=['POST', 'GET']) +@page.route("/login", methods=['POST', 'GET']) def show(): if (flask.request.method == ['GET']): return (flask.render_template("login/login.html")) diff --git a/main.py b/main.py index 7322ec1..0b12f10 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,13 @@ import flask import database -import home, login +import home, login, panel, register app = flask.Flask(__name__) if (__name__ == "__main__"): - app.register_blueprint(home.home) - app.register_blueprint(login.login) + app.register_blueprint(home.page) + app.register_blueprint(login.page) + app.register_blueprint(panel.page) + app.register_blueprint(register.page) app.run(host="0.0.0.0") diff --git a/panel.py b/panel.py new file mode 100644 index 0000000..0f853f5 --- /dev/null +++ b/panel.py @@ -0,0 +1,7 @@ +import flask + +page = flask.Blueprint("panel", __name__, template_folder="templates") + +@page.route("/") +def show(): + return (flask.render_template("panel/panel.html")) diff --git a/register.py b/register.py new file mode 100644 index 0000000..720acae --- /dev/null +++ b/register.py @@ -0,0 +1,7 @@ +import flask + +page = flask.Blueprint("register", __name__, template_folder="templates") + +@page.route("/register") +def show(): + return (flask.render_template("register/register.html"))