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')
.