update hotfix
This commit is contained in:
@@ -12,7 +12,7 @@ from .mainapp import mainapp
|
|||||||
def create_app(*args):
|
def create_app(*args):
|
||||||
# create and configure the app
|
# create and configure the app
|
||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
app.config['APPLICATION_ROOT'] = '/hsk'
|
app.config["APPLICATION_ROOT"] = "/hsk"
|
||||||
|
|
||||||
# ensure the instance folder exists
|
# ensure the instance folder exists
|
||||||
instance_path = Path(app.instance_path)
|
instance_path = Path(app.instance_path)
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
# Pip
|
# Pip
|
||||||
from flask import Blueprint, current_app, render_template, send_from_directory
|
from flask import Blueprint, current_app, render_template, send_from_directory
|
||||||
|
from jinja2 import TemplateNotFound
|
||||||
|
|
||||||
homescreen = Blueprint("homescreen", __name__, template_folder="templates")
|
homescreen = Blueprint("homescreen", __name__, template_folder="templates")
|
||||||
|
|
||||||
|
|
||||||
@homescreen.route("/")
|
@homescreen.route("/")
|
||||||
def show():
|
def index():
|
||||||
return render_template(f"index.html")
|
return render_template(f"index.html")
|
||||||
|
|
||||||
|
|
||||||
@@ -14,3 +15,13 @@ def favicon():
|
|||||||
return send_from_directory(
|
return send_from_directory(
|
||||||
current_app.static_folder, "favicon.ico", mimetype="image/vnd.microsoft.icon"
|
current_app.static_folder, "favicon.ico", mimetype="image/vnd.microsoft.icon"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@homescreen.route("/", defaults={"page": "index"})
|
||||||
|
@homescreen.route("/<page>")
|
||||||
|
def show(page):
|
||||||
|
print(page)
|
||||||
|
try:
|
||||||
|
return render_template(f"{page}.html")
|
||||||
|
except TemplateNotFound:
|
||||||
|
abort(404)
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
# Pip
|
# Pip
|
||||||
from flask import Blueprint, render_template, request
|
from flask import Blueprint, render_template, request
|
||||||
|
|
||||||
mainapp = Blueprint("mainapp", __name__, template_folder="templates", url_prefix="/app", static_folder="static")
|
mainapp = Blueprint(
|
||||||
|
"mainapp",
|
||||||
|
__name__,
|
||||||
|
template_folder="templates",
|
||||||
|
url_prefix="/app",
|
||||||
|
static_folder="static",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@mainapp.route("/", methods=["GET", "POST"])
|
@mainapp.route("/", methods=["GET", "POST"])
|
||||||
|
|||||||
Reference in New Issue
Block a user