summaryrefslogtreecommitdiffhomepage
path: root/apioforum/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'apioforum/admin.py')
-rw-r--r--apioforum/admin.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/apioforum/admin.py b/apioforum/admin.py
new file mode 100644
index 0000000..b11b735
--- /dev/null
+++ b/apioforum/admin.py
@@ -0,0 +1,14 @@
+from flask import (
+ Blueprint, render_template
+)
+from .db import get_db
+from .permissions import admin_required
+
+bp = Blueprint("admin",__name__,url_prefix="/admin")
+
+@bp.route("/")
+@admin_required
+def admin_page():
+ db = get_db()
+ admins = db.execute("select * from users where admin > 0;").fetchall()
+ return render_template("admin/admin_page.html",admins=admins)