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"))
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"