Configure refresh via config file

This commit is contained in:
mandlm 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 = "."
refresh = 5

View File

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

View File

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