def post(self):
     arg_username = self.request.get('username')
     arg_password = self.request.get('password')
     hashed_pass = hash_password(arg_password)
     existing_user = User.all().filter('username = '******'exists':True
         }
         return self.response.out.write(render_template('signup.html', context))
Beispiel #2
0
 def post(self):
     arg_username = self.request.get('username')
     arg_password = self.request.get('password')
     hashed_pass = hash_password(arg_password)
     exist_user_query = db.GqlQuery("SELECT * FROM User WHERE username = '******' AND hashed_pass = '******'")
     exist_user = exist_user_query.fetch(1)
     if len(exist_user) is 0:
         return self.response.out.write("wrong info")
     else:
         session = get_current_session()
         if session.has_key('user'):
             return self.response.out.write("already logged")
         else:
             session['user'] = exist_user[0]
             return self.redirect("/")