예제 #1
0
파일: kotodo.py 프로젝트: Irchiel/kotodo
def index():
    username = request.get_cookie('U', secret=secret())
    password = request.get_cookie('P', secret=secret())
    if check_user(username, password):
        return template('todo')
    else:
        return template('login', error=None)
예제 #2
0
파일: kotodo.py 프로젝트: Irchiel/kotodo
def postlogin():
    username = request.forms.get('username')
    password = request.forms.get('password')
    if check_user(username, password):
        response.set_cookie('U', username, secret=secret())
        response.set_cookie('P', password, secret=secret())
        redirect('/')
    else:
        return template('login', error='Wrong username or password. Please try again.')