Exemple #1
0
def login(request):
    email = request.POST['email']
    password = request.POST['password']
    result = usermodels.fetchone(email, password)
    if result is None:
        return HttpResponseRedirect('/user/loginform?result=fail')
    # login 처리
    request.session['auth'] = result
    return HttpResponseRedirect('/')
Exemple #2
0
def update(request):
    no = request.session['authuser']['no']
    name = request.POST['name']
    email = request.POST['email']
    password = request.POST['password']
    gender = request.POST['gender']

    usermodels.update(name, email, password, gender, no)

    result = usermodels.fetchone(email, password)
    request.session['authuser']['name'] = name

    return render(request, 'user/update.html')
Exemple #3
0
def login(request):
    email = request.POST['email']
    password = request.POST['password']

    result = userModels.fetchone(email, password)

    if result is None:
        data = {'result': 'fail'}
        return render(request, 'user/loginform.html', data)

    # 로그인 처리
    request.session['authuser'] = result

    return HttpResponseRedirect('/main')
Exemple #4
0
def test_userModel_login(email, password):
    userModels.fetchone(email, password)


# test_userModel_insert('마이콜', '*****@*****.**', '2345', 'male')
# test_userModel_login('*****@*****.**', '1234')
Exemple #5
0
def test_usermodels_fetchone():
    result = user_models.fetchone('*****@*****.**', '1234')
    print(result)
Exemple #6
0
def test_usermodels_fetchone():
    result = usermodels.fetchone('*****@*****.**', '1234')
    print(result)
def updateform(request):
    result = fetchone(request.session['authuser']['email'],
                      request.session['authuser']['password'])
    data = {'user': result}

    return render(request, 'user/updateform.html', data)