Flask-Web-App-Tutorial icon indicating copy to clipboard operation
Flask-Web-App-Tutorial copied to clipboard

im having a problem where auth.py routes are not showing up when i put them in my url.

Open RonKat2008 opened this issue 2 years ago • 2 comments

RonKat2008 avatar Jul 04 '22 22:07 RonKat2008

from flask import Blueprint

auth = Blueprint('auth', name)

@auth.route('/login') def login(): return "< p >Login< /p >"

@auth.route('/logout') def logout(): return "< p >Logout < /p >"

@auth.route('/sign-up') def sign_up(): return "< p >Sign Up< /p >"

RonKat2008 avatar Jul 04 '22 22:07 RonKat2008

the second parameter in the blueprint name is a not valid input try __name__

auth = Blueprint('auth', __name__)


@auth.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        ......

bibinthomas123 avatar Jul 06 '22 16:07 bibinthomas123