mod = Blueprint('users', __name__, url_prefix='/users')
@mod.route('/welcome')
def www():
return '<h1>Hello</h1>'
@mod.before_app_request
def before_request():
return redirect(url_for('www'))
This code give me this error:
raise BuildError(endpoint, values, method)
BuildError: ('www', {}, None)
If I try this one, I will get an infinite loop redirect in the browser.
return redirect(url_for('users.www'))
My question is, how can I redirect the before_app_request
to another action?
EDIT: log after changes, Now the redirect works, but the error still exists.