Esempio n. 1
0
def index():
    return render_template('index.html')
    if "loggedin" in session:
        if request.method == "GET":
            users = User.objects()
            return redirect(url_for("service_page"))
    else:
        return redirect(url_for("login"))
Esempio n. 2
0
def login():
    if request.method == "GET":
        return render_template('login.html')
    elif request.method == "POST":
        form = request.form
        username = form['username']
        password = form['password']
        all_user = User.objects()
        if username == "username" and password == "password":
            session['loggedin'] = True
            return redirect(url_for('service_page'))
        else:
            return "Wrong"