fix: use blueprint

This commit is contained in:
starnakin 2023-06-04 12:51:13 +02:00
parent 00723801cc
commit 4ad4deea87
3 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,7 @@
import main
import flask
@main.app.route("/", methods = ['GET'])
def home():
home = flask.Blueprint("home", __name__, template_folder="templates")
@home.route("/")
def show():
return (flask.render_template("home/index.html"))

View File

@ -1,10 +1,12 @@
import main
import flask
@main.app.route("/login", methods = ['POST', 'GET'])
def login():
if (flask.request.methods == ['GET']):
login = flask.Blueprint("login", __name__, template_folder="templates")
@login.route("/login", methods=['POST', 'GET'])
def show():
if (flask.request.method == ['GET']):
return (flask.render_template("login/login.html"))
else:
return ("bozo")
email = flask.request.form['email']
password = flask.request.form['password']

View File

@ -1,8 +1,11 @@
import flask
import database
import home, login
app = flask.Flask(__name__)
if (__name__ == "__main__"):
app.register_blueprint(home.home)
app.register_blueprint(login.login)
app.run()