clean: rename page variale && add: panel and register
This commit is contained in:
parent
58c9504d61
commit
514f037968
4
home.py
4
home.py
@ -1,7 +1,7 @@
|
|||||||
import flask
|
import flask
|
||||||
|
|
||||||
home = flask.Blueprint("home", __name__, template_folder="templates")
|
page = flask.Blueprint("home", __name__, template_folder="templates")
|
||||||
|
|
||||||
@home.route("/")
|
@page.route("/")
|
||||||
def show():
|
def show():
|
||||||
return (flask.render_template("home/index.html"))
|
return (flask.render_template("home/index.html"))
|
||||||
|
4
login.py
4
login.py
@ -1,8 +1,8 @@
|
|||||||
import flask
|
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():
|
def show():
|
||||||
if (flask.request.method == ['GET']):
|
if (flask.request.method == ['GET']):
|
||||||
return (flask.render_template("login/login.html"))
|
return (flask.render_template("login/login.html"))
|
||||||
|
8
main.py
8
main.py
@ -1,11 +1,13 @@
|
|||||||
import flask
|
import flask
|
||||||
import database
|
import database
|
||||||
import home, login
|
import home, login, panel, register
|
||||||
|
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
if (__name__ == "__main__"):
|
if (__name__ == "__main__"):
|
||||||
app.register_blueprint(home.home)
|
app.register_blueprint(home.page)
|
||||||
app.register_blueprint(login.login)
|
app.register_blueprint(login.page)
|
||||||
|
app.register_blueprint(panel.page)
|
||||||
|
app.register_blueprint(register.page)
|
||||||
app.run(host="0.0.0.0")
|
app.run(host="0.0.0.0")
|
||||||
|
|
||||||
|
7
panel.py
Normal file
7
panel.py
Normal 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
7
register.py
Normal 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"))
|
Loading…
Reference in New Issue
Block a user