def do_admin_login(): school= select_school(request.form['username']) if request.form['password'] == school.getPassword(): session['logged_in'] = True else: session['logged_in'] = False flash('wrong password!') return home()
def do_admin_login(): school = select_school(request.form['username']) if request.form['password'] == school.getPassword(): session['logged_in'] = True else: session['logged_in'] = False flash('wrong password!') return home()
def login(): username = request.form['logname'].strip() school = select_school(username) if school is not None: if request.form['logpass'] == school.password: session['logged_in'] = True session['username'] = username session['name'] = school.name return redirect('/home') return redirect('/')
def login(): username = request.form['username'] school = select_school(username) if school is None: return home() if request.form['password'] == school.password: session['logged_in'] = True session['id_school'] = school.id else: flash('wrong password') return home()
def trainning(): username = session['username'] filename = select_school(username).filepath listColumn, theta, mu, sigma = strain(path(filename)) round_theta = np.round(theta, 3).tolist() round_mu = np.round(mu, 3).tolist() round_sigma = np.round(sigma, 3).tolist() return jsonify( theta= round_theta, mu= round_mu, sigma= round_sigma, listColumn = listColumn )
def predictR(): A=[] username = session['username'] filename = select_school(username).filepath listColumn, theta, mu, sigma = strain(path(filename)) data = request.get_json(force=True) for i in range(0, len(listColumn)-1): key = 'param' + str(i) A.append(float(data[key])) X = np.array(A) print X predictd = predict(X, theta, mu, sigma).tolist() return str(round(predictd[0],2))
def home(): username = session['username'] school = select_school(username) if school.filepath is not None: session['uploaded'] = True return render_template("home.html")