Ported examples over to new config. documented upgrading

This commit is contained in:
Armin Ronacher 2010-05-27 21:17:25 +02:00
parent 02b916d509
commit dfecc86dd3
17 changed files with 122 additions and 39 deletions

View file

@ -63,9 +63,9 @@ notified about that and the user asked again::
def login():
error = None
if request.method == 'POST':
if request.form['username'] != USERNAME:
if request.form['username'] != app.config['USERNAME']:
error = 'Invalid username'
elif request.form['password'] != PASSWORD:
elif request.form['password'] != app.config['PASSWORD']:
error = 'Invalid password'
else:
session['logged_in'] = True