From 42f8ac8a53330e1df47ff63c844124e41dafb3ab Mon Sep 17 00:00:00 2001 From: Arne Baeumler Date: Sat, 5 Jun 2021 16:23:12 +0200 Subject: [PATCH] add date --- app.py | 5 +++++ templates/base.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 7c5b5a0..44f546e 100644 --- a/app.py +++ b/app.py @@ -34,6 +34,11 @@ app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1) app.secret_key = 'eng5iikeiwah3lae4idoo0woh4eiy6Th' +@app.context_processor +def get_date(): + date = datetime.now() + return { "now": date.strftime("%Y-%m-%d") } + @app.route('/', methods = ['GET', 'POST']) def index(): if request.method == 'POST': diff --git a/templates/base.html b/templates/base.html index 498d570..3a522ca 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,7 +16,7 @@ {% block content %}{% endblock %} \ No newline at end of file