예제 #1
0
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()
예제 #2
0
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()
예제 #3
0
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('/')
예제 #4
0
파일: server.py 프로젝트: doanbk/hetrogiup
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()
예제 #5
0
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()
예제 #6
0
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
    )
예제 #7
0
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))
예제 #8
0
def home():
    username = session['username']
    school = select_school(username)
    if school.filepath is not None:
        session['uploaded'] = True
    return render_template("home.html")