clean: rename page variale && add: panel and register

This commit is contained in:
starnakin 2023-06-05 18:47:29 +02:00
parent 58c9504d61
commit 514f037968
5 changed files with 23 additions and 7 deletions

View File

@ -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"))

View File

@ -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"))

View File

@ -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")

7
panel.py Normal file
View File

@ -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"))

7
register.py Normal file
View File

@ -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"))