from flask import Blueprint, render_template, request, url_for import os bp = Blueprint("home", __name__, url_prefix="/") @bp.route("/") def home(): path = "postit/static/contents" pages = [f.name for f in os.scandir(path) if f.is_dir()] return render_template("home.html", pages=pages)