Exemple #1
0
    def post(self):
        username = self.request.get("username")
        password = self.request.get("password")
        params = dict(username=username)
        error_flag = False

        if username == "":
            params['error_username'] = "******"
            error_flag = True
        if password == "":
            params['error_password'] = "******"
            error_flag = True

        if error_flag:
            self.render("login.html", **params)
        else:
            usr_details = User.all().filter('username ='******'/')
            else:
                self.render("login.html", username=username, error_validation="Invalid login details")
Exemple #2
0
 def register(cls, reg_username, reg_password, reg_email):
     hashed_pwd = validation.hash_password(reg_username, reg_password)
     usr = User(username = reg_username, password = hashed_pwd, email = reg_email)
     usr.put()
     return usr