python-flask-template/blueprintname.py
2025-03-09 11:41:17 +01:00

20 lines
525 B
Python
Executable file

from flask import Blueprint, render_template, current_app
from .cache import cache
blueprintname = Blueprint("blueprintname", __name__, template_folder="templates", static_folder="static")
def get_attribution():
return current_app.config['ATTRIBUTION']
def get_app_config():
return current_app.config['APPS']['blueprintname']
@blueprintname.route("/")
@cache.cached(timeout=300)
async def home():
# DO STUFF...
return render_template("_home.html", app=get_app_config(), attribution=get_attribution())