Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1066037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:57:21+00:00 2026-05-16T19:57:21+00:00

I modify the login of flaskr sample app, the first line get error. But

  • 0

I modify the login of flaskr sample app, the first line get error. But http://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) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T19:57:21+00:00Added an answer on May 16, 2026 at 7:57 pm

    return redirect(url_for('www')) would work if you have a function somewhere else like this:

    @app.route('/welcome')
    def www():
        return render_template('www.html')
    

    url_for looks for a function, you pass it the name of the function you are wanting to call. Think of it like this:

    @app.route('/login')
    def sign_in():
        for thing in login_routine:
            do_stuff(thing)
        return render_template('sign_in.html')
    
    @app.route('/new-member')
    def welcome_page():
        flash('welcome to our new members')
        flash('no cussing, no biting, nothing stronger than gin before breakfast')
        return redirect(url_for('sign_in')) # not 'login', not 'sign_in.html'
    

    You could also do return redirect('/some-url'), if that is easier to remember. It is also possible that what you want, given your first line, is just return render_template('www.html').

    And also, not from shuaiyuancn’s comment below, if you are using blueprints, url_for should be invoked as url_for('blueprint_name.func_name') Note you aren’t passing the object, rather the string. See documentation here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user input form here: http://www.7bks.com/create (Google login required) When you first
I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but
Is it possible to modify the title of the message box the confirm() function
Is it possible to modify a registry value (whether string or DWORD) via a
If I modify or add an environment variable I have to restart the command
I'm trying to modify the class of an element if an ajax call based
How can I modify a SharePoint site so that versioning is turned on by
I need to modify a (xml-)file from Apache Ant. loadfile task allows to load
Is it possible to modify/write data to an XML file without any server-side proxy(e.g.
I would like to modify a Spotlight metadata attribute of a file within my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.