Configure refresh via config file

This commit is contained in:
Michael Mandl 2018-11-05 22:01:57 +01:00
parent 5031b1e8a2
commit 0f07fb70c8
3 changed files with 3 additions and 2 deletions

View file

@ -1 +1,2 @@
imgdir = "." imgdir = "."
refresh = 5

View file

@ -12,7 +12,7 @@ app = Flask(__name__)
@app.route("/") @app.route("/")
def random(): def random():
return render_template("random.html") return render_template("random.html", refresh=config.refresh)
@app.route("/random_image/") @app.route("/random_image/")

View file

@ -1,6 +1,6 @@
<html> <html>
<head> <head>
<meta http-equiv="refresh" content="5;url={{ url_for("random") }}"> <meta http-equiv="refresh" content="{{ refresh }};url={{ url_for("random") }}">
</head> </head>
<body bgcolor="black"> <body bgcolor="black">
<img src="{{ url_for("random_image") }}" style="height: 98%; width: 100%; object-fit: contain"/> <img src="{{ url_for("random_image") }}" style="height: 98%; width: 100%; object-fit: contain"/>