def Login():
    form = LoginFormStructure(request.form)

    if (request.method == 'POST' and form.validate()):
        if (db_Functions.IsLoginGood(form.username.data, form.password.data)):
            return redirect('DataModel')
        else:
            flash('Incorrect username and/or password.')

    return render_template(
        'login.html',
        form=form,
        title='Login Page',
        year=datetime.now().year,
        repository_name='Pandas',
    )
예제 #2
0
def Login():
    form = LoginFormStructure(request.form)

    if (request.method == 'POST' and form.validate()):
        if (db_Functions.IsLoginGood(form.username.data, form.password.data)):
            flash('Login approved!')
            return redirect('query')
        else:
            flash('Error in - Username and/or password')

    return render_template(
        'login.html',
        form=form,
        title='Login to data analysis',
        year=datetime.now().year,
        repository_name='Pandas',
    )