Matthew Welch 308b1e1791 Re-structured code and added search feature for comics.
The project structure has been changed to make it more manageable and modular. A search feature has been added to the comics page.
2019-07-23 15:50:25 -07:00

16 lines
520 B
Python

from flask import Blueprint, flash, redirect, url_for, render_template
from flask_login import login_required, current_user
from sqlite_web import sqlite_web
Admin = Blueprint("admin", __name__, template_folder="templates")
login_required(sqlite_web.index)
@Admin.route("/admin")
@login_required
def index():
if not current_user.is_admin:
flash("you must be an admin to access this page, login with an admin account.")
return redirect(url_for("login"))
return render_template("admin/index.html", title="Admin")