Flask error: werkzeug.routing.BuildError

Viewed 66540

I modify the login of flaskr sample app, the first line get error. But www.html is in the template dir.

return redirect(url_for('www'))
#return redirect(url_for('show_entries'))

display error:

werkzeug.routing.BuildError

BuildError: ('www', {}, None) 
3 Answers

I came across this error

BuildError: ('project_admin', {}, None)

when I had a call like

return redirect(url_for('project_admin'))

in which I was trying to reference the project_admin function within my Blueprint. To resolve the error, I added a dot before the name of the function, like this:

return redirect(url_for('.project_admin'))

and voila, my problem was solved.

Related