fix: use blueprint
This commit is contained in:
		
							
								
								
									
										7
									
								
								home.py
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								home.py
									
									
									
									
									
								
							@ -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"))
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								login.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								login.py
									
									
									
									
									
								
							@ -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']
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user