from flask import Blueprint,render_template,session,redirect,url_for from werkzeug.security import generate_password_hash admin = Blueprint('admin',__name__) @admin.route("/admin") def admin_page(): if ( "username" in session): return render_template("admin.html",username=session["username"]) return redirect(url_for("login/"))