update hotfix
This commit is contained in:
@@ -12,7 +12,7 @@ from .mainapp import mainapp
|
||||
def create_app(*args):
|
||||
# create and configure the app
|
||||
app = Flask(__name__, instance_relative_config=True)
|
||||
app.config['APPLICATION_ROOT'] = '/hsk'
|
||||
app.config["APPLICATION_ROOT"] = "/hsk"
|
||||
|
||||
# ensure the instance folder exists
|
||||
instance_path = Path(app.instance_path)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# Pip
|
||||
from flask import Blueprint, current_app, render_template, send_from_directory
|
||||
from jinja2 import TemplateNotFound
|
||||
|
||||
homescreen = Blueprint("homescreen", __name__, template_folder="templates")
|
||||
|
||||
|
||||
@homescreen.route("/")
|
||||
def show():
|
||||
def index():
|
||||
return render_template(f"index.html")
|
||||
|
||||
|
||||
@@ -14,3 +15,13 @@ def favicon():
|
||||
return send_from_directory(
|
||||
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
|
||||
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"])
|
||||
@@ -18,7 +24,7 @@ def show():
|
||||
print(deck_type, language, output_type)
|
||||
print()
|
||||
state = "complete"
|
||||
elif request.method == "POST":
|
||||
elif request.method == "POST":
|
||||
state = "ready"
|
||||
form = request.form.to_dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user