def get(self): session = get_current_session() if session['account'] is None: self.redirect('/login') else: path = os.path.join(os.path.dirname(__file__), '../templates/account.html') self.response.out.write(template.render(path,{'data':{'account':session['account']}}))
def post(self): required = ['email','password'] if application.required(required,self.request): account = accounts.Account.get_by_key_name(self.request.get('email')) if account is not None and account.check_password(self.request.get('password')): session = get_current_session() session.regenerate_id() session['account'] = account self.redirect('/account') else: Login.get(self)
def post(self): from hashlib import sha256 required = ['email','password','password_confirm'] if application.required(required,self.request) and self.request.get('password') == self.request.get('password_confirm'): exist_account = accounts.Account.get_by_key_name(self.request.get('email')) if exist_account is None: account = accounts.Account.new(key_name = self.request.get('email'), email=self.request.get('email'),password=self.request.get('password')) account.put() session = get_current_session() session.regenerate_id() session['account'] = account self.redirect('/account') else: Register.get(self) else: Register.get(self)
def get(self): session = get_current_session() session.terminate() self.redirect('/')