Flask error: werkzeug.routing.BuildError

后端 未结 3 1595
野的像风
野的像风 2020-12-23 16:16

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(u         


        
3条回答
  •  攒了一身酷
    2020-12-23 16:25

    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.

提交回复
热议问题