From 67e52efbd29b7e9b671b23252c4cb870d40985c0 Mon Sep 17 00:00:00 2001 From: km0 Date: Thu, 2 Mar 2023 12:45:57 +0100 Subject: [PATCH] first request render --- readme.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme.py b/readme.py index 6deb0e6..7b9b461 100644 --- a/readme.py +++ b/readme.py @@ -63,15 +63,22 @@ def send_image(filename): @app.route("/update", methods=["GET", "POST"]) def update(): if request.method == "POST": + print("Rendering the homepage after weebhook request") pull() render() return "GET method not supported" @app.route("/render") -def request_render(): +def manual_render(): + print("Manual rendering the homepage") render() return redirect(url_for("home")) +@app.before_first_request +def prepare_page(): + print("Rendering the homepage") + render() app.run(port=PORT, debug=DEBUG) +