Exemplo n.º 1
0
    def get(self, request):

        # gets user's value from current Session
        user = session.get(request, 'user')

        # through template engine hold user's value exchange to page and return
        return simple_template('index.html', user=user, message='Hi, World!')
Exemplo n.º 2
0
    def get(self, request):

        # from GET request gets state parameter, if not exist then return default value 1
        state = request.args.get('state', '1')

        # through template return login page, when state isn't 1, page information return username error or not exist
        return simple_template('layout.html',
                               title='login',
                               message='input username' if state == '1' else
                               'username error or not exist, re-enter')
Exemplo n.º 3
0
 def get(self):
     user = session.get(self.request, 'user')
     return simple_template('index.html', message='current user', user=user)
Exemplo n.º 4
0
    def get(self):
        if 'user' in self.session_map:
            return redirect('/')

        return simple_template('login/login.html')
Exemplo n.º 5
0
 def get(self):
     return simple_template('user/list.html',
                            value=self.wechat.message_map.get(
                                'auto_replay', ''))
Exemplo n.º 6
0
    def get(self, request):

        # when get GET request through template return a register page
        return simple_template('layout.html',
                               title='register',
                               message='input register name')