Пример #1
0
 def todo(instance, arg=None):
     if ('token' not in web.cookies()) \
         and ('auth' not in session or session.get('auth') == 0):
         raise web.seeother('/login')
     if arg:
         return func(instance, arg)
     return func(instance)
Пример #2
0
 def GET(self):
     print web.ctx
     cur_user = session.get('register')
     if cur_user:
         session.pop('register')
         return render.login(cur_user=cur_user)
     else:
         return render.login(cur_user=None)
Пример #3
0
def index():
    username = request.cookies.get('username')
    user = session.get('username')
    print(username, user)
    return render_template('index.html', **locals())