WebAdminPanel/apps/admin.py

21 lines
581 B
Python
Raw Normal View History

2022-09-01 09:24:40 -04:00
from flask import Blueprint,render_template,session,redirect,url_for
2022-08-29 12:10:44 -04:00
from werkzeug.security import generate_password_hash
2022-12-10 08:14:21 -05:00
from database import Member
2022-08-29 12:10:44 -04:00
admin = Blueprint('admin',__name__)
2022-12-02 16:12:00 -05:00
@admin.route("/")
2022-08-29 12:10:44 -04:00
def admin_page():
2022-09-01 09:24:40 -04:00
if ( "username" in session):
2022-12-10 08:14:21 -05:00
return render_template("index.html", username=session["username"])
2022-12-02 16:12:00 -05:00
return redirect(url_for("auth.login_page"))
2022-12-10 08:14:21 -05:00
2022-12-11 08:51:44 -05:00
@admin.route("/stat")
def chart():
return render_template("statistics.html")
2022-12-10 08:14:21 -05:00
@admin.route("/members")
def table_of_members():
return render_template("members.html", members=Member.select())