WebAdminPanel/apps/admin.py

21 lines
581 B
Python

from flask import Blueprint,render_template,session,redirect,url_for
from werkzeug.security import generate_password_hash
from database import Member
admin = Blueprint('admin',__name__)
@admin.route("/")
def admin_page():
if ( "username" in session):
return render_template("index.html", username=session["username"])
return redirect(url_for("auth.login_page"))
@admin.route("/stat")
def chart():
return render_template("statistics.html")
@admin.route("/members")
def table_of_members():
return render_template("members.html", members=Member.select())